'Rake Aborted, Argument Error when pushing to heroku
I am following the Ruby on Rails Tutorial 4th Edition by Michael Hartl and I have been unable to deploy even the simple hello world application to Heroku. I keep getting an ArgumentError and I am unsure how to fix this. Will greatly appreciate any help.
Below is the build log from Heroku:
Activity Feed Build LogID fd6c52c9-e67b-4ef8-a97c-ea70bbf2cbc7
-----> Building on the Heroku-20 stack
-----> Determining which buildpack to use for this app
! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
Detected buildpacks: Ruby,Node.js
See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
-----> Ruby app detected
-----> Installing bundler 2.2.33
-----> Removing BUNDLED WITH version in the Gemfile.lock
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-3.0.3
-----> Installing dependencies using bundler 2.2.33
Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
Fetching gem metadata from https://rubygems.org/..........
Fetching rake 13.0.6
Installing rake 13.0.6
Fetching minitest 5.10.3
Fetching builder 3.2.4
Fetching thread_safe 0.3.6
Fetching concurrent-ruby 1.1.9
Installing builder 3.2.4
Installing minitest 5.10.3
Installing thread_safe 0.3.6
Fetching erubi 1.10.0
Fetching mini_portile2 2.8.0
Installing concurrent-ruby 1.1.9
Installing erubi 1.10.0
Installing mini_portile2 2.8.0
Fetching racc 1.6.0
Fetching crass 1.0.6
Fetching rack 2.2.3
Installing racc 1.6.0 with native extensions
Installing crass 1.0.6
Installing rack 2.2.3
Fetching nio4r 2.5.8
Installing nio4r 2.5.8 with native extensions
Fetching websocket-extensions 0.1.5
Fetching mini_mime 1.1.2
Installing mini_mime 1.1.2
Installing websocket-extensions 0.1.5
Fetching arel 8.0.0
Installing arel 8.0.0
Using bundler 2.2.33
Fetching coffee-script-source 1.12.2
Installing coffee-script-source 1.12.2
Fetching execjs 2.8.1
Fetching method_source 1.0.0
Installing execjs 2.8.1
Installing method_source 1.0.0
Fetching thor 1.2.1
Fetching ffi 1.15.5
Installing thor 1.2.1
Fetching multi_json 1.15.0
Installing multi_json 1.15.0
Installing ffi 1.15.5 with native extensions
Fetching pg 0.20.0
Installing pg 0.20.0 with native extensions
Fetching puma 3.9.1
Installing puma 3.9.1 with native extensions
Fetching rb-fsevent 0.11.1
Installing rb-fsevent 0.11.1
Fetching tilt 2.0.10
Installing tilt 2.0.10
Fetching turbolinks-source 5.2.0
Installing turbolinks-source 5.2.0
Fetching tzinfo 1.2.9
Installing tzinfo 1.2.9
Fetching rack-test 1.1.0
Installing rack-test 1.1.0
Fetching i18n 1.10.0
Installing i18n 1.10.0
Fetching sprockets 3.7.2
Installing sprockets 3.7.2
Fetching websocket-driver 0.6.5
Installing websocket-driver 0.6.5 with native extensions
Fetching mail 2.7.1
Installing mail 2.7.1
Fetching coffee-script 2.4.1
Installing coffee-script 2.4.1
Fetching uglifier 3.2.0
Installing uglifier 3.2.0
Fetching nokogiri 1.13.3 (x86_64-linux)
Fetching turbolinks 5.0.1
Installing turbolinks 5.0.1
Fetching activesupport 5.1.6
Installing nokogiri 1.13.3 (x86_64-linux)
Installing activesupport 5.1.6
Fetching globalid 1.0.0
Installing globalid 1.0.0
Fetching activemodel 5.1.6
Installing activemodel 5.1.6
Fetching jbuilder 2.7.0
Installing jbuilder 2.7.0
Fetching activejob 5.1.6
Installing activejob 5.1.6
Fetching activerecord 5.1.6
Installing activerecord 5.1.6
Fetching rails-dom-testing 2.0.3
Fetching loofah 2.14.0
Installing rails-dom-testing 2.0.3
Installing loofah 2.14.0
Fetching rails-html-sanitizer 1.4.2
Installing rails-html-sanitizer 1.4.2
Fetching actionview 5.1.6
Installing actionview 5.1.6
Fetching actionpack 5.1.6
Installing actionpack 5.1.6
Fetching actioncable 5.1.6
Fetching actionmailer 5.1.6
Installing actioncable 5.1.6
Installing actionmailer 5.1.6
Fetching railties 5.1.6
Fetching sprockets-rails 3.2.2
Installing sprockets-rails 3.2.2
Installing railties 5.1.6
Fetching coffee-rails 4.2.2
Fetching jquery-rails 4.3.1
Installing coffee-rails 4.2.2
Fetching rails 5.1.6
Installing rails 5.1.6
Installing jquery-rails 4.3.1
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching sass-listen 4.0.0
Installing sass-listen 4.0.0
Fetching sass 3.7.4
Installing sass 3.7.4
Fetching sass-rails 5.0.6
Installing sass-rails 5.0.6
Bundle complete! 21 Gemfile dependencies, 58 gems now installed.
Gems in the groups 'development' and 'test' were not installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from sass:
Ruby Sass has reached end-of-life and should no longer be used.
* If you use Sass as a command-line tool, we recommend using Dart Sass, the new
primary implementation: https://sass-lang.com/install
* If you use Sass as a plug-in for a Ruby web framework, we recommend using the
sassc gem: https://github.com/sass/sassc-ruby#readme
* For more details, please refer to the Sass blog:
https://sass-lang.com/blog/posts/7828841
Bundle completed (23.00s)
Cleaning up the bundler cache.
-----> Installing node-v16.13.1-linux-x64
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
ArgumentError: wrong number of arguments (given 3, expected 2)
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/static.rb:109:in `initialize'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:35:in `new'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:35:in `build'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:99:in `block in build'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:99:in `each'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:99:in `inject'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/actionpack-5.1.6/lib/action_dispatch/middleware/stack.rb:99:in `build'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/engine.rb:508:in `block in app'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/engine.rb:504:in `synchronize'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/engine.rb:504:in `app'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:45:in `block in <module:Finisher>'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in `run'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in `block in run_initializers'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in `run_initializers'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/application.rb:353:in `initialize!'
/tmp/build_5ee85a76/config/environment.rb:5:in `<top (required)>'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/application.rb:329:in `require_environment!'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/railties-5.1.6/lib/rails/application.rb:445:in `block in run_tasks_blocks'
/tmp/build_5ee85a76/vendor/bundle/ruby/3.0.0/gems/sprockets-rails-3.2.2/lib/sprockets/rails/task.rb:61:in `block (2 levels) in define'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app.
! Push failed
Here is the Gemfile I am using (directly taken from the book).
source 'https://rubygems.org'
gem 'rails', '5.1.6'
gem 'puma', '3.9.1'
gem 'sass-rails', '5.0.6'
gem 'uglifier', '3.2.0'
gem 'coffee-rails', '4.2.2'
gem 'jquery-rails', '4.3.1'
gem 'turbolinks', '5.0.1'
gem 'jbuilder', '2.7.0'
group :development, :test do
gem 'sqlite3', '1.3.13'
gem 'byebug', '9.0.6', platform: :mri
end
group :development do
gem 'web-console', '3.5.1'
gem 'listen', '3.1.5'
gem 'spring', '2.0.2'
gem 'spring-watcher-listen', '2.0.1'
end
group :test do
gem 'rails-controller-testing', '1.0.2'
gem 'minitest', '5.10.3'
gem 'minitest-reporters', '1.1.14'
gem 'guard', '2.13.0'
gem 'guard-minitest', '2.4.4'
end
group :production do
gem 'pg', '0.20.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
