7

I've found a couple similar posts regarding this same problem, but none of the solutions seem to apply, here.

On a fresh Ubuntu 10.10 install, I follow the instructions for installing RVM:

$ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )

Then I create .bash_profile and add the following line:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

I restart the terminal and check RVM:

$ type rvm | head -1
-bash: type: rvm: not found

As the RVM installation guide explains to do so, I replaced the first line (below) in .bashrc with the second one, then indented everything in the rest of the file and added a fi.

[ -z "$PS1" ] && return     # original
if [[ -n "$PS1" ]]; then    # replaced with this

Restarted terminal and still, no luck.

Then, I removed the line I added to .bash_profile in the beginning and added it to .bashrc, even though that isn't what the guide said to do. Still, no luck. I also entered it directly on the command line, with no change in behavior. When I run .rvm from ~/.rvm/bin/rvm it complains that there is no such file or directory as /.rvm/scripts/rvm and that the command was not fund.

Of course, there isn't any such "scripts" directory inside of ./rvm, either -- so I'm not sure why it's looking for one? The only directories inside of .rvm are

archives
bin
config
gems
gemsets
log
man
rubies
src
tmp
user

The only thing I've found while googling for answers are other people complaining of similar problems and people telling them to add the instructed line to .bash_profile (which I obviously already did). At this point, I have nothing more to go on and am at an impasse.

Regards.

Resolution: As Andrew Marshall advised in his comments, below, I did an 'rm -rf .rvm' and reinstalled rvm. I had actually attempted this two times before posting here, with the same results every time. No odd messages in the install log, but no /scripts/ directory, either. Just so I could say I had, I did it a third time at Andrew's urging. This time, I checked and the /scripts/ directory existed. Running 'type rvm | head -1' confirmed it as a 'function' and I can now move on.

pstack
  • 73
  • 1
  • 1
  • 6
  • Also don't forget to `rm -rf` the .gpg/ dir if you decide to blow everything away and start over. There was some bad data in there somewhere that was messing things up for me. – kingsfoil Jan 22 '16 at 18:50

2 Answers2

12

Make sure that you restart a session after reinstalling, so that rvm is in your path.

You can try to logout/login.

You can also open your shell as a login shell. Under ubuntu 12.04:

  • Open a terminal
  • Edit > Profile Preferences
  • Under tab Title and Command, check run Command as a login shell
  • Open new terminal (ctrl+alt+t) and type rvm
Benjamin Crouzier
  • 40,265
  • 44
  • 171
  • 236
  • You can add RVM to your path in open terminals by running `source /home/USERNAME/.rvm/scripts/rvm` - as stated in the RVM installer output. Unless it's a part of a larger install script, I'd recommend just restarting the terminal. [View RVM installer output](https://i.stack.imgur.com/SkUPN.png) – James L. Dec 14 '16 at 18:36
4

If there's no scripts directory inside .rvm, it would seem that RVM failed to successfully complete installation. Delete the .rvm directory, try reinstalling, and look at the installation output closely to see if it's complaining about anything.

Andrew Marshall
  • 95,083
  • 20
  • 220
  • 214
  • When I first found /scripts/ missing, doing an rm -rf .rvm was my first response. Twice, in fact. Same results, both times. Not wanting to disregard your advice, I attempted it a third/fourth time - changing nothing else. And I'll be damned if it didn't work, this time. The directory is there and the test confirms that rvm is a function. I'm baffled as to why it failed a total of three times in a row, before finally installing properly - and it hadn't complained the first three times, either. The install log/output was identical. Odd! Anyway, thanks for the additional input! – pstack Mar 24 '11 at 01:51
  • The first few times did you try using `sudo`? Sudo and RVM do not mix, except in specific, system-wide installs, which normal users should not use. Using `sudo` causes the environment to change to root's environment, with the end result being that RVM doesn't install correctly for the user. – the Tin Man Mar 24 '11 at 03:10
  • Before these attempts, I had another instance of ubuntu on which I saw the same. As I'd been a bit groggy at the time, I wondered if I'd sudo'd out of habit and popped another fresh ubuntu instance where sudo absolutely wasn't used. Since I'm not familiar with RVM, I'm not sure what to expect if it had a network hiccup downloading or some other issue. I'm an engineer by day, so I know _"I didn't do anything different!"_ sounds suspect. But I really didn't. :) If I have a chance, I may try to reproduce again. Suspect it wouldn't happen running of a downloaded tar, though. – pstack Mar 24 '11 at 04:23
  • I doubt using `sudo` would've caused the problems, as the directory would have existed, just without the correct permissions. I'm curious as to what the contents of `/.rvm/src` were before when it wasn't working and if the `scripts` directory was present in there. – Andrew Marshall Mar 24 '11 at 05:21