How do I safely upgrade my ruby on rails app to use a new ruby version, using rvm?
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- How to specify memcache server to Rack::Session::M
- Why am I getting a “C compiler cannot create execu
相关文章
- Ruby using wrong version of openssl
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- Difference between Thread#run and Thread#wakeup?
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
Suppose your app is my_app and you are using ruby version a.b.c and want to go to ruby version x.y.z.
Step 0
Before starting, make sure you have the up to date version of rvm
Step 1
First if you do not have a gemset for your current ruby version create one and make it the default. This gives you an easy way to go back if your upgrade breaks your tests. If you do not want to do this, go to step 2.
The switch to that gemset and install the gems into that gemset, and make it the default gemset for the directory
Step 2
Now upgrade to the new ruby version and create a gemset for it.
It is considered best practice to specify the ruby version in your Gemfile so make sure you have
ruby 'x.y.z'
at the top of your Gemfile. ThenThis is where the fun can start, you may get errors at this point and use a combination of following the error instructions or googling for help, etc to solve them. When you can bundle successfully, then run all your tests.
When your tests have all passed, then you have successfuly upgraded. If you get stuck, you can go back to your old installation, using
rvm a.b.c@my_app_abc
.Once you are happy with your new installation then do
to make this the default setup for this app. This means when you change into this app from other projects, it will automatically load ruby version x.y.z and the corresponding gemset.