-1

我需要安装 ruby​​ 1.8.7 和 rails 2.3.4 因为我需要修改旧应用程序。(RVM 中最新的 ruby​​ 和 gems 对我来说很好,但我需要使用这个旧的 gems 和 ruby​​)//runing ubuntu 12.04

问题是当我尝试运行 rake gems:install (我也不能做 rails new app)

我无法解决这个问题,而且我没有太多时间。提前感谢您的帮助。

$ rvm 使用 1.8.7 使用 /home/user/.rvm/gems/ruby-1.8.7-p370

$ rvm gemset use gemset234 使用 ruby​​-1.8.7-p370 和 gemset gemset234

$宝石清单

*当地宝石*

actionmailer (2.3.4) actionpack (2.3.4) activerecord (2.3.4) activeresource (2.3.4) activesupport (2.3.4) bundler (1.1.5, 0.9.1) rack (1.0.1) rails (2.3. 4) rake (0.9.2.2, 0.8.7) ruby​​gems-bundler (1.0.3) ruby​​gems-update (1.8.24) rvm (1.11.3.5)

$ 耙宝石:安装

/home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:287:in `resolve': Could not find gem 'rails (= 1.8.7) ruby' in the gems available on this machine. (Bundler::GemNotFound)
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:161:in `start'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:128:in `resolve'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:127:in `catch'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/resolver.rb:127:in `resolve'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/definition.rb:192:in `resolve'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/definition.rb:127:in `specs'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/gems/bundler-1.1.5/lib/bundler/environment.rb:27:in `specs'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:41:in `candidate?'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:60:in `setup'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/noexec.rb:75
    from /home/user/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in `gem_original_require'
    from /home/user/.rvm/rubies/ruby-1.8.7-p370/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:60:in `require'
    from /home/user/.rvm/gems/ruby-1.8.7-p370@gemset234/bin/ruby_noexec_wrapper:9
4

1 回答 1

1

这是 rails 2 中 gem 安装系统的一个缺点。如果运行 rake 需要依赖项,例如本例中的 rails,您将需要手动安装它。为这些依赖项中的每一个执行 gem install 直到 rake 最终运行。

于 2012-07-31T09:50:30.993 回答