问题描述
我只是试图浏览railsapps.org 学习Ruby on Rails 在线预订.我已经安装了所有内容,并被本教程中的启动Web服务器"困住了.
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.
当我执行'$ rails server'时,我得到以下信息:
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>'
我不理想,问题出在哪里,因为我目前对Rails或Ruby一无所知.进入壁垒相当大,不是吗?看来,gem sprockets-rails中存在问题,但是由于我什至还没有开始使用Rails,所以我不知道如何处理该问题或从何处开始.
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.
推荐答案
https://github.com/rails/sprockets-rails/issues/131
等待修复程序发布或将其添加到您的Gemfile
Wait for a fix to be released or simply add to your Gemfile
gem 'sprockets-rails', :require => 'sprockets/rails/version'
这篇关于无法启动Rails服务器-未初始化的常量Sprockets :: Rails :: VERSION::( NameError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!