安装rails 4 beta后可以启动新的rails 3.2项目

时间:2013-04-20 18:12:50

标签: ruby-on-rails gem ruby-on-rails-4

我安装了rails 4 beta1试用。现在,我正在尝试使用rails version hack创建一个新的rails 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/

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

2 个答案:

答案 0 :(得分:11)

将您的rubygems更新为2.0.3

gem update --system

不要惊慌!这只是Rails 3

rails _3.2.13_ new demo

答案 1 :(得分:0)

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

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