Lykos Lykos - 9 days ago 4
Ruby Question

Having different rails and gems versions installed on dev environment

I'm quite newbie in ruby and ruby on rails and I'd like some clarification, if possible.

I'm currently having rails

4.2.6
installed on my development environment in which I have built a few projects. Now, for my new projects I'd like to use Rails 5, so I assume that if I type the
gem install rails
command will get me the latest rails verion and probably set it as default, so every time I want to create a new project by
rails new my_new_project_name
this project will have the latest version (currently v5).

My question is will my gem list contain both rails versions then or is it going to cause any conflicts and issues to my old porjects? so, if I want to work back on any of my projects which has the "old" version, won't affect of any changes, right? As far as I understand its the
bundler
who picks the version of each gem, right?

If thats the case, I assume same thing applies and for every other gem that I use for each project, right?

Answer

You will have all different versions. BUT you will need to add the version number for all gems to your gemfile

For example enter image description here

and in the gemfile you state:

gem 'remotipart', '1.2.1'