Permission problem when trying to installing ruby 2.3

rails

#1

I am trying to install ruby 2.3 by running “rvm install 2.3”. However, there is a permission-related problem:

Failed to create the file ruby-2.3.4.tar.bz2.part: Permission denied

I tried running the command appending sudo but it doesn’t work.


#2

The following worked for me, installing rbenv and then ruby-build:
cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo ‘export PATH="$HOME/.rbenv/bin:PATH"' >> ~/.bashrc echo 'eval "(rbenv init -)"’ >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo ‘export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"’ >> ~/.bashrc
exec $SHELL

rbenv install 2.3.0
rbenv global 2.3.0
ruby -v


#3

@LUNDR , many thanks for your tip…just one slight correction which can prove to be very confusing since it invalidates the user’s PATH. The reference to PATH on the right-hand of “=” on line 3 needs to be preceded by “$” as shown below to be sure that it is replaced by the current path.

cd
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc 
echo 'eval "(rbenv init -)"' >> ~/.bashrc
exec $SHELL

git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
exec $SHELL

rbenv install 2.3.1
rbenv global 2.3.1
ruby -v