无法运行rails服务器

时间:2012-06-03 00:58:15

标签: ruby-on-rails ruby terminal

我正在努力获取我的第一个rails应用程序,但无论出于何种原因,当我运行命令$rails server时,我的终端会抛出这个错误:

/Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'jquery-rails (= 2.0.0) ruby' in the gems available on this machine. (Bundler::GemNotFound)
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/environment.rb:27:in `specs'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:60:in `setup'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
    from /Users/Toni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/Toni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
    from /Users/Toni/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/Toni/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:9:in `<main>'

我在Stack Overflow上找不到任何内容。有什么想法吗?

3 个答案:

答案 0 :(得分:4)

您需要在启动时安装Rails使用的必需gem。在您运行rails s之前,请务必运行bundle installbundle update

答案 1 :(得分:2)

确保您的Gemfile有一行如下所示:gem 'jquery-rails'

然后从项目目录:bundle install

答案 2 :(得分:1)

因为在Rubygems服务器上,该版本显示:

2.0.0 December 20, 2011 yanked