1

我正在努力获取我的第一个 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 上找不到任何东西。有任何想法吗?

4

3 回答 3

4

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

于 2012-06-03T01:02:50.430 回答
2

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

然后从您的项目目录中:bundle install

于 2012-06-03T01:06:57.933 回答
1

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

2.0.0 December 20, 2011 yanked
于 2012-09-11T09:31:34.220 回答