1
votes

I want to push my first application in Heroku, but my push failed. I have this error in my shell;

Bundle completed (197.95s)
remote:        Cleaning up the bundler cache.
remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Installing yarn-v1.22.4
remote:        Detected manifest file, assuming assets were compiled locally
remote: -----> Detecting rails configuration
remote: -----> Detecting rake tasks
remote:
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     /tmp/build_edcc391d/bin/rake:4:in `require': cannot load such file -- rake (LoadError)
remote:  !     from /tmp/build_edcc391d/bin/rake:4:in `<main>'
remote:  !
remote: /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError)
remote: ensure you can run `$ bundle exec rake -P` against your app
remote: and using the production group of your Gemfile.
remote: /tmp/build_edcc391d/bin/rake:4:in `require': cannot load such file -- rake (LoadError)
remote:     from /tmp/build_edcc391d/bin/rake:4:in `<main>'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/ruby.rb:1106:in `rake'
remote:     from /tmp/codon/tmp/buildpacks/50d5eddf222a9b7326028041d4e6509f915ccf2c/lib/language_pack/rails2.rb:85:in `has_jobs_work_task?'
bla bla bla 

So, this is my Gemfile

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.2'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.1.0'
# Use postgresql as the database for Active Record
gem 'pg', '~> 1.1'
# Use Puma as the app server
gem 'puma', '~> 5.0'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 5.0'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
gem 'bcrypt'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
#gem 'bootsnap', '>= 1.5.1', require: true

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 4.1.0'
  # Display performance information such as SQL time and flame graphs for each request in your browser.
  # Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
  gem 'rack-mini-profiler', '~> 2.0'
  gem 'listen', '~> 3.3'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 3.26'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'faker'
gem 'table_print'
gem 'bootstrap'
gem 'jquery-rails'
gem 'rake'
gem 'rack-timeout'

I think I tried everything. Here is what I tried for resolve this error;

  • add gem 'rake' and gem 'rack-timeout' in my Gemfile
  • bundle install
  • git commit -m "Modified Gemfile.lock"
  • add RAILS_SERVE_STATIC_FILES env. to yr server.
  • RAILS_ENV=production bundle exec rake assets:precompile (If I run RAILS_ENV=production bundle exec rake assets:precompile, I have this)
sh: /Users/mac/Library/Mobile: No such file or directory
sh: /Users/mac/Library/Mobile: No such file or directory
Warning: you are using an unstable release of Node.js (v15.4.0). If you encounter issues with Node.js, consider switching to an Active LTS release. More info: https://docs.npmjs.com/try-the-latest-stable-version-of-node
Everything's up-to-date. Nothing to do
  • git add public/assets
  • git commit -m "vendor compiled assets"
  • ...

But nothing, I have this error again and again ... If anyone can help me I will be very grateful.

Thank you.

1

1 Answers

0
votes

Could you please share your Gemfile.lock? I faced the same problem and solved it by changing PLATFORMS from x86_64-darwin-19 to ruby.