Will installing multiple versions of Rails overwrite previous installations?

What happens if I print in gem install rails using different versions of Rails?

For example, I can enter:

gem install rails --verson 3.2.10

or

gem install rails

which gives me version 3.2.12.

Questions

  • Will each installation overwrite the previous one?

  • Will it delete all the old files and add the new version that I am installing?

  • Or, if I run it twice, will it save some files?

I am using Ubuntu.

+5
source share
2 answers

He will install two separate gems. The actual executable railswill reference the latest version.

You can override this with

<gem_command> _<version>_

For instance,

rails _3.2.10_

Run Rails 3.2.10.

Bundler

, Ruby on Rails , , , Bundler. Bundler Gemfile , , , .

, . gem install rails rails new app - , .

+9

enthrops, gem Rails , :

. rails .

rbenv Ruby, Rails

~/.rbenv/versions/<rubyVersion>/lib/ruby/gems/<rubyVersion>/gems/rails-<version>

, Rails:

$ ls -l ~/.rbenv/versions/2.0.0-p451/lib/ruby/gems/2.0.0/gems/ | \
$ grep --extended-regexp "(\s)rails-"
drwxr-xr-x  4 foobar staff  136 May 13 19:07 rails-4.0.0
drwxr-xr-x  4 foobar staff  136 May 13 18:41 rails-4.0.5
drwxr-xr-x  4 foobar staff  136 Apr 19 21:27 rails-4.1.0
+1

All Articles