How to Downgrade from Ruby 1.9.2 to Ruby 1.8.7 to run Rails 2.0.2

后端 未结 3 1827
独厮守ぢ
独厮守ぢ 2020-12-09 05:13

I want to downgrade the Ruby version I have installed(Ruby 1.9.2) on Ubuntu 10.04 OS so that I can use the appropriate version of Ruby 1.8.7 to run Rails 2.0.2. I am using t

相关标签:
3条回答
  • 2020-12-09 05:18

    Whole point of RVM is so that you can have multiple versions of Ruby and switch among them easily..

    rvm install 1.8.7 #or some specific version - choose from the rvm list known
    rvm use 1.8.7
    rvm gemset create rails202 #create a gemset called "rails202" for Ruby 1.8.7
    rvm 1.8.7@rails202 #make the gemset the current selection
    gem install rails -v 2.0.2 #install rails (just for this gemset!)
    #now, we have a gemset called "rails202" in Ruby 1.8.7.
    #anytime we want to use it, we do:
    rvm 1.8.7@rails202
    #create as many gemsets needed, eg for rails 3.0.3 on Ruby 1.8.7 we can do the
    #similar as above. Then to use the new gemset just do:
    rvm 1.8.7@rails303
    #et voila! we are now using Rails 3.0.3 on Ruby 1.8.7 !
    
    0 讨论(0)
  • 2020-12-09 05:29

    source ~/.rvm/scripts/rvm

    rvm reload ( Reload the latest rvm installed )

    rvm install 1.8.7

    rvm use 1.8.7 --default

    0 讨论(0)
  • 2020-12-09 05:42

    Use RVM and save yourself weeks of pain.

    You can use multiple Ruby versions and each version has it's own separate set of gems. That way you can have 1.8.7 and 1.9.2 installed simultaneously with Rails 2 and Rails 3 gems on the former and the latter respectively.

    Installing a Ruby version is as simple as typing rvm install 1.9.2 or rvm install 1.8.7. To switch between the two: rvm 1.9.2 or rvm 1.8.7.

    You can set the default Ruby with rvm --default 1.9.2 or rvm --default 1.8.7.

    RVM won't touch your local Ruby nor it's gems. You can switch back to it at any time: rvm system.

    0 讨论(0)
提交回复
热议问题