Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Possible sprockets-rails gem issue?

I've just created a new Vagrant box to be able to develop my Rails app. The box is brand new and has Ruby, MySQL etc installed to be able to develop.

I've installed all gems etc but when I try to start the app I get the following:

vagrant@neiltongesite:/vagrant/source$ bundle exec foreman start
17:45:02 rails.1 | started with pid 5910
17:45:05 rails.1 | /home/vagrant/.gem/ruby/2.2.7/gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:108:in `block in <class:Railtie>': undefined method `+' for false:FalseClass (NoMethodError)
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `instance_exec'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:30:in `run'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:55:in `block in run_initializers'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `each'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `call'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
17:45:05 rails.1 |  from /opt/rubies/ruby-2.2.7/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/initializable.rb:54:in `run_initializers'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/application.rb:352:in `initialize!'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `public_send'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/railtie.rb:194:in `method_missing'
17:45:05 rails.1 |  from /vagrant/source/config/environment.rb:5:in `<top (required)>'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
17:45:05 rails.1 |  from /vagrant/source/config.ru:3:in `block in <main>'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:55:in `instance_eval'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:55:in `initialize'
17:45:05 rails.1 |  from /vagrant/source/config.ru:in `new'
17:45:05 rails.1 |  from /vagrant/source/config.ru:in `<main>'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:49:in `eval'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:49:in `new_from_string'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/builder.rb:40:in `parse_file'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:299:in `build_app_and_options_from_config'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:208:in `app'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:61:in `app'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/rack-1.6.5/lib/rack/server.rb:336:in `wrapped_app'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/server.rb:78:in `start'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:75:in `server'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
17:45:05 rails.1 |  from /home/vagrant/.gem/ruby/2.2.7/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
17:45:05 rails.1 |  from bin/rails:4:in `require'
17:45:05 rails.1 |  from bin/rails:4:in `<main>'
17:45:05 rails.1 | => Booting Puma
17:45:05 rails.1 | => Rails 4.2.5.1 application starting in development on http://0.0.0.0:3000
17:45:05 rails.1 | => Run `rails server -h` for more startup options
17:45:05 rails.1 | => Ctrl-C to shutdown server
17:45:05 rails.1 | Exiting
17:45:05 rails.1 | exited with code 1
17:45:05 system  | sending SIGTERM to all processes

I've looked but can't seem to figure out what is causing it.

Anyone able to point me in the right direction?

like image 351
rctneil Avatar asked May 02 '17 17:05

rctneil


1 Answers

The exception is thrown on this line, so I guess you have the following somewhere in your configuration files:

config.assets.precompile = false

This configuration setting should define an array of assets that you want to be precompiled, it should not be set to false. See the Rails guides for more info.

To test this hypothesis I configured a test Rails 5 project with the above line and got the same exception:

.../gems/sprockets-rails-3.2.0/lib/sprockets/railtie.rb:108:in `block in <class:Railtie>': undefined method `+' for false:FalseClass (NoMethodError)
like image 168
Matouš Borák Avatar answered Oct 27 '22 01:10

Matouš Borák