开发者

Things to do before upgrading Ruby

开发者 https://www.devze.com 2022-12-15 01:25 出处:网络
What should I do before upgrading to the latest version of Ruby? any tips? Update sorry for my unclear ques开发者_JS百科tion.

What should I do before upgrading to the latest version of Ruby? any tips?

Update

sorry for my unclear ques开发者_JS百科tion.

my condition: I've upgraded my Ruby from 1.8.7 to 1.9.1p243. It makes me can not use all installed gems.

so, what should I do before upgrading Ruby? uninstall all my installed gems? I was looking in other SO posts in here, But there are no answers for my question.


Unless you are using custom GEM environment variables or a .gemrc (or some multi ruby system like rvm) then the locations where rubygems are installed for each ruby installation will be different.

You can manage the locations used by rubygems by managing the GEM_HOME and GEM_PATH environment variables or the .gemrc file. It is possible to set your gems to be shared across ruby installations with these variables or the .gemrc

.gemrc: http://docs.rubygems.org/read/chapter/11

GEM Environment variables: http://docs.rubygems.org/read/chapter/12#page52

You can find the environment settings for a rubygems installation by running:

/path/to/gem env

This will output something like the following:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.3.4
  - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin10.0.0]
  - INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
  - RUBY EXECUTABLE: /opt/local/bin/ruby
  - EXECUTABLE DIRECTORY: /opt/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-darwin-10
  - GEM PATHS:
     - /opt/local/lib/ruby/gems/1.8
     - /home/aji/.gem/ruby/1.8
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["http://gems.rubyforge.org/", "http://gemcutter.org"]
  - REMOTE SOURCES:
     - http://gems.rubyforge.org/
     - http://gemcutter.org

While the number of rubygems that are compatible with ruby 1.9 is constantly growing, you will need to check with the maintainer or homepage of each gem/project to verify if your gems will work or not.

Also check previous questions on SO regarding differences between 1.8 & 1.9: What is the difference between Ruby 1.8 and Ruby 1.9

0

精彩评论

暂无评论...
验证码 换一张
取 消