1

我安装了 rails 4 beta1 来试用。现在,我正在尝试使用rails version hackrails 3.2创建一个新应用程序,但它不起作用。

$ gem list rails

*** LOCAL GEMS ***

rails (4.0.0.beta1, 3.2.13, 3.1.0)

$ rails -v
Rails 4.0.0.beta1

$ rails _3.2.13_ demo
/home/gaurish/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems.rb:317:in `bin_path': can't find gem rails (["3.2.13"]) with executable rails (Gem::GemNotFoundException)
    from /home/gaurish/.rvm/gems/ruby-2.0.0-p0/bin/rails:19:in `<main>'
    from /home/gaurish/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/gaurish/.rvm/gems/ruby-2.0.0-p0/bin/ruby_noexec_wrapper:14:in `<main>'

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.25
  - RUBY VERSION: 2.0.0 (2013-02-24 patchlevel 0) [i686-linux]
  - INSTALLATION DIRECTORY: /home/gaurish/.rvm/gems/ruby-2.0.0-p0
  - RUBY EXECUTABLE: /home/gaurish/.rvm/rubies/ruby-2.0.0-p0/bin/ruby
  - EXECUTABLE DIRECTORY: /home/gaurish/.rvm/gems/ruby-2.0.0-p0/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/gaurish/.rvm/gems/ruby-2.0.0-p0
     - /home/gaurish/.rvm/gems/ruby-2.0.0-p0@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => 1
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-rdoc --no-ri --verbose"
  - REMOTE SOURCES:
     - http://rubygems.org/

出了什么问题,我该如何解决这个问题,以便我可以同时安装 rails 4 和 rails 3.2?

4

2 回答 2

11

将您的 ruby​​gems 更新到 2.0.3

gem update --system

不要惊慌!这只是 Rails 3

rails _3.2.13_ new demo
于 2013-04-20T19:46:03.557 回答
0

今天早些时候有同样的问题。

删除 rails 4.0.0.beta1 并重新安装它,然后rails _3.2.13__按照您的问题中所述使用解决了我的问题。

于 2013-04-20T19:19:18.307 回答