I have installed two different version of rails in same gem set. When I do gem list rails it will show as follows:
**rails (3.0.11, 2.3.8)** // This means I have two rails
When I create new rails application it will take latest one, that means app should be created using rails new app_name not using rails app_name.
But I want to use rails 2.3.8 instead of 3.0.11. I know that using RVM helps in switching between different version of rails but they are installed in different gem set. Is there any possibility to switch between different rails version in same gem set?
Thank you.
To know all rails versions released, you check out on all rails versions. You can also do it with your terminal with the command line gem list rails --remote --all | grep "^rails " . I you want to install rails on another version of ruby, you need to switch version of ruby and re-install version of rails.
You can install a specific gem version with gem install [name] -v [version] and use it as [name] _[version]_ [command] [line] [args] .
Every Rails project has the version of Rails in the Gemfile that it will use separately from every other app. There's nothing you need to do to manage two different Rails versions. The only thing you'll want to do is gem install rails to get the latest version and create your new project with rails new myapp .
By using the "RBENV_VERSION=1.9. 2-p290" prefix in your command line, you're specifying which ruby rbenv should be concerned with. Then following that with the "rbenv exec" command, you can install rails. Just use the version flag as in the example to specify which version you want.
The later version has higher precedence. You have to be explicit when create app by:
rails _3.0.11_ new my_app
OR
rails _2.3.8_ my_app
I'm assuming you are not using Bundler if you are trying to use 2.3.8, so check your config/enrvironment.rb file and change the RAILS_GEM_VERSION to '2.3.8'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With