pyenv uses Python rbenv is used when you want to manage multiple versions of Ruby.
This time, I decided to install both pyenv and rbenv in / usr / local
.
It seems that there are many other derivative repositories such as phpenv, plenv and anyenv. For the time being, I installed Python and Ruby this time. Should other things be done in the same way?
It is troublesome to use sudo -i
to read and sudo the settings of the file written under /etc/profile.d/
.
pyenv
Place it in / usr / local
.
sudo git clone git://github.com/yyuu/pyenv.git /usr/local/pyenv
sudo git clone git://github.com/yyuu/pyenv-virtualenv.git /usr/local/pyenv/plugins/pyenv-virtualenv
Write a file that will be read at startup ...
/etc/profile.d/pyenv.sh
export PYENV_ROOT="/usr/local/pyenv"
export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)"
Reboot the shell
exec $SHELL -l
rbenv
This is also the same.
sudo git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
sudo git clone git://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
Write a file that will be read at startup ...
/etc/profile.d/rbenv.sh
export RBENV_ROOT="/usr/local/rbenv"
export PATH="${RBENV_ROOT}/bin:${PATH}"
eval "$(rbenv init -)"
Reboot the shell
exec $SHELL -l
It is successful if the path newly set by which ruby
or which python
appears.
The basic usage is similar for both
#List the installable versions
pyenv install -l
#Install the given version(In this case 3.4.2)
sudo -i pyenv install 3.4.2
#Confirm that the specified version is installed
pyenv versions
#If you want to use it only under a specific folder
cd /home/jibun/python3/
pyenv local 3.4.2
sudo -i pyenv rehash
#When setting to the whole
pyenv global 3.4.2
sudo -i pyenv rehash
#List the installable versions
rbenv install -l
#Install the given version(In this case 2.1.3)
sudo -i rbenv install 2.1.3
#Confirm that the specified version is installed
rbenv versions
#If you want to use it only under a specific folder
cd /home/jibun/ruby2.1/
rbenv local 2.1.3
sudo -i rbenv rehash
#When setting to the whole
rbenv global 2.1.3
sudo -i rbenv rehash
The articles referred to this time are as follows. http://qiita.com/la_luna_azul/items/3f64016feaad1722805c http://qiita.com/youcune/items/a5cc93313641b69b62f8
Recommended Posts