Add existing ruby ​​to RVM

I had ruby ​​1.8.7 and rails 2.3.5 installed on my car. I had RVM installed with ruby ​​1.9.3 and rails 3.2.0.

So, I want to add existing ruby ​​1.8.7 to RVM. How can i do this?

+6
source share
4 answers

To install ruby ​​1.8.7 via RVM

rvm install ruby-1.8.7 

Use existing ruby ​​system

 rvm use system 
+5
source
  • rvm install 1.8.7 install ruby ​​1.8.7
  • find the project folder in the shell
  • rvm use 1.8.7 you are using 1.8.7 for this project
  • rvm gemset create gemsetname create a gemset for your project with 1.8.7
  • gem install bundler install the picker, you NEED to configure the switch for rails 2.3
  • bundle install #install gems
  • add rvm use 1.8.7-p352@gemsetname --create to your .rvmrc file
  • enjoy :)

these steps will work fine in version 3.x for 2.3, you need to configure the package

+4
source

The rvm mount command allows you to associate existing ruby ​​installations with rvm. See this answer for an example on how to use it.

+2
source

when using rvm, the best practice is to create a gemset

 rvm gemset create mygemset 

and then create the .rvmrc file

 rvm --create --rvmrc ruby-1.8.7-p352@mygemset 

Run the command above from the rails directory with the obviously correct ruby ​​version (install if it is not already installed ... rvm install ruby-1.8.7) and gemset. This way rvm will automatically install the correct ruby ​​version for your project.

Hope this helps

0
source

Source: https://habr.com/ru/post/918633/


All Articles