Reputation: 23
I have installed Ruby On Rails version 6.0.3.2 but now I want to change it to Version 5. How can I do it? Do I uninstall version 6 and install 5? What command should I use please?
Upvotes: 0
Views: 1571
Reputation: 18504
You can have multiple versions of a gem installed:
gem install rails -v 5.2.4.4
And all modern rails versions have a way to select which specific one to use when creating a new app:
rails _5.2.4.4_ new application_name
If you want to downgrade an existing app - first search for a commit that upgraded it, if you're very lucky - a simple revert can do the job. But in more general case - you have to make your code compatible with older version (remove new feature usage etc), and fiddle with gem versions inside the Gemfile
. Do a bundle update
after edit - when a lower version is specified in requirements it will downgrade. Note that rails may be not the only gem requiring downgrade
Upvotes: 2