Installing ruby with rbenv

4

I have a question, I installed ruby in ubuntu, but it was installed without rbenv , have a problem install it now, or will it need to remove it first?

    
asked by anonymous 07.10.2016 / 16:19

3 answers

2

Robson, the ideal is to remove first to guard against any conflict problem between the Ruby versions. Leave everything to rbev.

sudo apt-get purge ruby rubygems
    
08.10.2016 / 16:55
2

rbenv is a very comprehensive but very useful tool when you need to use multiple versions on different projects, so if you do not need this, the default installation should suit you well.

    
11.10.2016 / 20:14
0

Installed via apt install ? If so! You do not need to uninstall what was installed via apt install .

Now if the installations through the "RVM" it is recommended to completely uninstall the "RMV" by executing the simple command in the terminal:

rvm implode

or

rm -rf ~/.rvm

It is to install rbenv that my opinion is not much better either the RVM: It is to type these simple command in the terminal.

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv

Then you should add rbenv in $PATH just run the command on the terminal.

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

and the command to start the rbenv script:

echo 'eval "$(rbenv init -)"' >> ~/.bashrc

ps: Repair the shell configuration file you are using on your machine, to be bash is the above if not and change to the file in question at the end of the command ".bashrc" to ".zshrc "for example.

After installation and just restart the terminal and execute the command:

rbenv install -l

And choose the desired version to install. Example:

rbenv install 2.3

To set the version globally on the machine:

rbenv global 2.3

Ready to run the ruby -v command is to check the installation.

I hope I have helped.

    
27.10.2016 / 20:13