Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating a symlink for Ruby while using RVM

I am following this https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-nginx-on-ubuntu-14-04

But i have installed Ruby using RVM as its easy to maintain ruby.

I am at the step to create a symlink for ruby which under this guide it says

sudo rm /usr/bin/ruby
sudo ln -s /usr/local/bin/ruby /usr/bin/ruby

But since i have used RVM and which i run which ruby i get the following path

root@99atoms-staging:~# which ruby
/usr/local/rvm/rubies/ruby-2.2.0/bin/ruby
like image 304
Harsha M V Avatar asked Feb 03 '15 06:02

Harsha M V


1 Answers

Use this:

sudo ln -sfn $(which ruby) /usr/bin/ruby

That is essentially the same for you as doing this:

sudo ln -s /usr/local/rvm/rubies/ruby-2.2.0/bin/ruby /usr/bin/ruby
like image 70
joelparkerhenderson Avatar answered Sep 30 '22 12:09

joelparkerhenderson