0

我是 Rails 的初学者,我一直关注 ruby​​.railstutorials.org,直到我坚持本节http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:1.4.1

在我安装 heroku gem 之后gem install heruku

我输入heroku keys:add然后我得到了这些错误。

/Users/xxx/.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/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:161:in `start'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:128:in `block in resolve'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `catch'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/resolver.rb:127:in `resolve'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/definition.rb:192:in `resolve'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/definition.rb:127:in `specs'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.4/lib/bundler/environment.rb:27:in `specs'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:60:in `setup'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.2/lib/rubygems-bundler/noexec.rb:75:in `<top (required)>'
    from /Users/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
    from /Users/xxx/.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/xxx/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
    from /Users/xxx/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:9:in `<main>'
abcs-MacBook-Pro-2:first_app xxx$ 

你能否让我知道如何解决它。

谢谢

4

2 回答 2

0

尝试使用正确的拼写再次安装 gem:

gem install heroku

检查您正在使用的 ruby​​ 版本

rvm list
ruby -v
gem list

你需要切换到正确的红宝石

rvm use <ruby version>

然后再次安装heroku。

于 2012-06-03T14:38:55.610 回答
0

获取Home Brew,然后运行命令“brew doctor”。如果它告诉您有错误,请修复这些错误。

我猜您使用的是 Mac,并且您可能正在运行 MacPorts。这样做存在问题,因为 MacPorts 使用 rvm 尝试访问的旧库。您需要从 brew doctor 计划的路径中删除 opt 和一堆东西。

于 2012-07-10T03:03:31.447 回答