Dotol
Dotol

Reputation: 406

Heroku Rails 5 LoadError: Could not load the 'listen' gem

I'm new to Heroku and have followed the Getting Started guide to the letter. However when I deploy my application with git push heroku master it begins building the application and stops after trying to precompile assets with the following error:

remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        LoadError: Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile
remote:        /tmp/build_78073b13aac28e116288169779278ade/vendor/bundle/ruby/2.4.0/gems/activesupport-5.0.2/lib/active_support/dependencies.rb:293:in `require'

I have verified that the gem is in fact inside the development group in my Gemfile and have tried moving the gem 'listen' outside the development scope as per answers on related questions but the problem persists.

Upvotes: 2

Views: 2207

Answers (1)

Anton
Anton

Reputation: 76

To resolve this issue you can either:

  • Comment out/remove the line config.file_watcher = ActiveSupport::EventedFileUpdateChecker in config/environments/development.rb or
  • Set RAILS_ENV=production in your heroku config variables. heroku config:set RAILS_ENV=production or
  • Copy the config/environments/production.rb into a new file config/environments/staging.rb and set RAILS_ENV=staging in your heroku config variables.

Personally I prefer the latter.

Good luck 🙃

Upvotes: 4

Related Questions