Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot launch rails server - uninitialized constants Sprockets::Rails::VERSION::(NameError)

I am simply trying to go through the railsapps.org Learn Ruby on Rails book online. I have everything installed and am stuck at "Launching the Web Server" in the tutorial.

When I execute '$ rails server', I get the following:

trick420$ rails server
=> Booting WEBrick
=> Rails 4.1.0 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
Exiting
/Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/sprockets-rails-2.1.2/lib/sprockets/railtie.rb:77:in `block in <class:Railtie>': uninitialized constant Sprockets::Rails::VERSION (NameError)
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:44:in `each'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/activesupport-4.1.0/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/application/finisher.rb:64:in `block in <module:Finisher>'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/initializable.rb:30:in `run'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in `block in tsort_each'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in `each_strongly_connected_component_from'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in `block in each_strongly_connected_component'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `call'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in `each_strongly_connected_component'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in `tsort_each'
from /Users/trick420/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in `tsort_each'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/application.rb:288:in `initialize!'
from /Users/trick420/learn-rails/config/environment.rb:5:in `<top (required)>'
from /Users/trick420/learn-rails/config.ru:3:in `require'
from /Users/trick420/learn-rails/config.ru:3:in `block in <main>'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/trick420/learn-rails/config.ru:in `new'
from /Users/trick420/learn-rails/config.ru:in `<main>'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/server.rb:50:in `app'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/server.rb:130:in `log_to_stdout'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/server.rb:67:in `start'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/railties-4.1.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/trick420/learn-rails/bin/rails:8:in `require'
from /Users/trick420/learn-rails/bin/rails:8:in `<top (required)>'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/lib/spring/client/rails.rb:27:in `load'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/lib/spring/client/rails.rb:27:in `call'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/lib/spring/client/command.rb:7:in `call'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/lib/spring/client.rb:26:in `run'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/bin/spring:48:in `<top (required)>'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/lib/spring/binstub.rb:11:in `load'
from /Users/trick420/.rvm/gems/ruby-2.1.1@learn-rails/gems/spring-1.1.2/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/trick420/learn-rails/bin/spring:16:in `require'
from /Users/trick420/learn-rails/bin/spring:16:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

I have no ideal what the issue is as I know nothing about Rails or Ruby at this point. Quite the barrier to entry, no? It appears that there is a problem in the gem sprockets-rails, but I have no idea how to deal with that or where to start as I haven't even got started with rails.

like image 692
trick420 Avatar asked Mar 20 '23 21:03

trick420


1 Answers

https://github.com/rails/sprockets-rails/issues/131

Wait for a fix to be released or simply add to your Gemfile

gem 'sprockets-rails', :require => 'sprockets/rails/version'
like image 89
khmm12 Avatar answered Mar 22 '23 12:03

khmm12