简体   繁体   中英

Upgrading form Ruby 1.9.2 to 1.9.3, Should I re-install all gems?

I would like to avoid re-installing the gems if possible while doing the upgrade from 1.9.2 to 1.9.3. Is there an option as such while using RVM to manage ruby versions?

you can run

rvm upgrade 1.9.2 1.9.3

this will:

  • install latest 1.9.3 (if needed)
  • copy all gemsets
  • run gem pristine on every single gem and report those that failed
  • ask you if you want to delete the old ruby

the step with gem pristine is required as there might be changes between rubies that would break stuff - especially that gem creators use internal ruby stuff.

I don't think so. The gems are installed on top of the specific version so I think you will need to reinstall. However with rails you should be able to just bundle install

Best Practice will also to be to create a gemset at the root of your project.

Here's mine:

$ cat .rvmrc 

rvm use ruby-1.9.3-p125@my_local_app_name --create

Then when you cd into it it will set the ruby and rails versions for you. You will see a nice green status line showing you that, eg

Using /Users/durrantm/.rvm/gems/ruby-1.9.3-p125 with gemset dmworkflow

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM