user3909863
user3909863

Reputation: 401

bash: /home/XXX/.rvm/scripts/rvm: No such file or directory

I just walk-through with the installation of Ruby on Rails on Ubuntu using RVM.

First I have logged in as the root user.

Then I started with the following commands.

  1. \curl -sSL https://get.rvm.io | bash -s stable --rails

    It has been installed without any error.

  2. source ~/.rvm/scripts/rvm

    When I run this command. It showing the error as bash: /home/XXX/.rvm/scripts/rvm: No such file or directory

I added the [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" command in my .bashr file.

Upvotes: 16

Views: 39079

Answers (13)

Joel Prabhakaran
Joel Prabhakaran

Reputation: 1

For me all the above methods didn't workout. After the installation and updates, still the terminal shows this "error bash: /root/.rvm/scripts/rvm: No such file or directory"

The simple method which helps me to solve this error is :

  1. Show Hidden Files
  2. Go to the Home (where the bash scripts are stored)
  3. Edit the .bashrc
  4. At the bottom you can find some lines about rvm just clear the rvm lines and save the file.
  5. Open terminal and check it.

Upvotes: 0

Temitayo Adeleke
Temitayo Adeleke

Reputation: 41

This source /usr/share/rvm/scripts/rvm works for me on ubuntu 20.04. I changed the local in /usr/local/rvm/scripts/rvm to share I assume that you have installed the rvm.

Upvotes: 1

Slava Zharkov
Slava Zharkov

Reputation: 237

If you install rvm via apt-get you can add the following line into ~/.zshrc or ~/.bashrc

source /etc/profile.d/rvm.sh

Upvotes: 0

Nayab Samar
Nayab Samar

Reputation: 1023

After installing rvm, try:

source ~/.rvm/scripts/rvm

If the above command throws some issue, try this command:

source /usr/local/rvm/scripts/rvm

Upvotes: 12

kyle
kyle

Reputation: 683

I think they may have moved some files around fixed with:

source /usr/share/rvm/scripts/rvm 

Upvotes: 11

Darshil Rathod
Darshil Rathod

Reputation: 1

Alright so when you get a failure message "No such file or directory", type

\curl -L https://get.rvm.io | bash -s stable

in your terminal. There will be a GPG signature verification failure. Bellow that failure there would be a link for github and a key something like this

gpg2 --recv-keys 409B6B...

So download a tar file from the github link and run this code to install GPG:

sudo apt install gnupg2

and run that key :

gpg2 --recv-keys 409B6B...

next run the code:

\curl -L https://get.rvm.io | bash -s stable

it will show you installing the rvm and then you can run:

source ~/.rvm/scripts/rvm

thats it you are good to go

Upvotes: 0

sudeep_dk
sudeep_dk

Reputation: 379

Install RVM:

gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

Now you will get a success message. Then, run this command:

\curl -sSL https://get.rvm.io | bash -s stable

See http://rvm.io/ for more info.

Upvotes: 24

Inx Maurya
Inx Maurya

Reputation: 1155

just create ~/.rvm/scripts/rvm directories, then try to install rvm but make sure you are not logged in as root.

Upvotes: 1

Caleb Mbakwe
Caleb Mbakwe

Reputation: 178

Your surest bet is to use home brew. Funny part is if you try brew upgrade ruby, you will have an error if brew wasn't used to install ruby in the first instance so use:

$ brew install ruby

Then afterwards use

$ brew upgrade ruby

You may need to close and reopen your terminal to see the effect of the upgrade by typing

$ ruby -v

Upvotes: -1

Oakland510
Oakland510

Reputation: 1083

Can you use sudo find to locate the correct path of the rvm directory? If you find the path, you should be able to rerun the source ~/.rvm/scripts/rvm command with the correct path.

Also, I fully agree with the previous answers about not creating it as root. DigitalOcean was a pretty good tutorial on adding users https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04

Upvotes: 0

Bijendra
Bijendra

Reputation: 10053

Firstly no need to go for sudo access while installing rvm, just follow the very basic commands below

   $\curl -sSL https://get.rvm.io | bash -s stable

This will install rvm.

   $ rvm list known
   # MRI Rubies
   [ruby-]1.8.6[-p420]
   [ruby-]1.8.7[-p374]
   [ruby-]1.9.1[-p431]
   [ruby-]1.9.2[-p320]
   [ruby-]1.9.3[-p545]
   [ruby-]2.0.0-p353

Install a version of ruby as required.

   $ rvm install 2.0.0-p353

Now you can use the version of ruby for which you need to install rails as a gem.

   $ rvm use 2.0.0

Also you can make it default if you want so

   $ rvm use 2.0 --default

Next you can install rails as a gem.

    $ gem install rails

gems should never be installed with sudo access as they change from project to project. rvm helps in managing the different versions of ruby in one m/c. You can also use gemsets to isolate gems and specific versions from one application to another.

Upvotes: 6

vgoff
vgoff

Reputation: 11343

As root, you traditionally don't have a /home folder. Root's home is different than a normal user.

You very likely don't want to install RVM as root.

Please do read the information at http://rvm.io specifically the installation notes.

Upvotes: 0

Benji
Benji

Reputation: 611

Is generally not recommend to install RVM as a root user because of umask security risk. Try running these commands as a user.

Downloading RVM (Do not sudo this command)

\curl -sSL https://get.rvm.io | bash -s stable --rails

Then you'll need to add the location to sources(You'll probably need to reload your bash for rvm to work)

source ~/.rvm/scripts/rvm

You can install your desired version like so(replace ruby_version with one you would like to install, eg 2.1.4)

rvm install ruby_version

To list the available version on your machine

rvm list

To use a version of ruby run

rvm use ruby_version

If you have any trouble refere to the RVM website

Upvotes: 0

Related Questions