0

I have been following the tutorial to install Ruby on Rails on the mac from this website:

http://ruby.railstutorial.org/

I installed rvm and it wasn't working. The tutorial said to enter this command:

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

After I did that it seemed to have loaded successfully as it said this:

~ DUFF$ rvm reload 
RVM reloaded!
~ DUFF$ rvm notes
Notes for Darwin ( Mac OS X )
For Lion, Rubies should be built using gcc rather than llvm-gcc. Since
/usr/bin/gcc is now linked to /usr/bin/llvm-gcc-4.2, add the following to
your shell's start-up file: export CC=gcc-4.2
(The situation with LLVM and Ruby may improve. This is as of 07-23-2011.)

For Snow Leopard be sure to have Xcode Tools Version 3.2.1 (1613) or later
You should download the latest Xcode tools from developer.apple.com.
  (This is since the dvd install for Snow Leopard contained bugs).

If you intend on installing MacRuby you must install LLVM first.
If you intend on installing JRuby you must install the JDK.
If you intend on installing IronRuby you must install Mono (version 2.6 or greater is recommended).

To seamlessly abandon the Apple-installed system ruby (ruby 1.8.7 patchlevel 174 for Snow Leopard):

rvm install 1.8.7 # installs patch 302: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system # migrate your gems
rvm --default 1.8.7


NOTE: For all installations, as of 1.7, RVM no longer autoloads .rvmrc files. In order to       return this functionality, you MUST add 'export rvm_project_rvmrc=1' to your $HOME/.rvmrc file. This causes RVM to override 'cd' which, while toggleable even < 1.7, is currently defaulted to 'off'. This knob returns the previous behaviour to active which causes per-project .rvmrc files to be loaded once again.

Example: echo 'export rvm_project_rvmrc=1' >> $HOME/.rvmrc && rvm reload

So after all of that I entered this as directed:

type rvm | head -n1

and it said:

-bash: type: rvm: not found

So after that long introduction my question would be do you know why it is not recognizing the rvm type after it seemed to have installed. I am a complete newbie so please be gentle. I have been having a ton of issues and this seemed to be moving along nicely up until this point.

Any help would be appreciated. Thanks.

2 Answers 2

1

Are you following this tutorial? http://beginrescueend.com/rvm/install/

You should run this entire command:

echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

That way it's appended to your .bash_profile file, and loaded in every new terminal. The command you entered will only load the rvm function for a single terminal session.

.rvm/scripts/rvm is a shell script itself that loads all necessary functions into your environment.

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks for the response. I tried that command and I am still getting the same response. However, I am such a newb that I may be testing it incorrectly. To see if it worked I simply type: rvm --version That is how I see if it worked. I am still getting the error that says that rvm command not found. I am rather baffled.
First you should verify that you ran the command correctly by running cat ~/.bash_profile, and make sure you see [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function at the end of the output. If you do, as @jonallard recommended, either open up a new terminal, or run the command source ~/.bash_profile to reload your environment. You should also make sure you have all the rvm scripts by listing the directory, ls ~/.rvm. You should see bin, scripts, config...etc. If all else fails, delete the rvm directory sudo rm -R ~/.rvm and start from the top.
Also, if you do start over, I recommend installing from the latest git version, run bash < <(curl -s https://rvm.beginrescueend.com/install/rvm), note that 'bash' is not some placeholder for your shell prompt, its part of the command...sorry to over explain but not sure how noob you are...haha
~ DUFF$ rvm --version rvm 1.7.2 by Wayne E. Seguin ([email protected]) [rvm.beginrescueend.com/] ~ DUFF$ ls ~/.rvm LICENCE config gemsets man tmp README contrib help patches user VERSION environments hooks rubies wrappers archives examples lib scripts bin gems log src
That is what I got. Looks like it worked. I just had to close the window and try again (indicating just how much of a newb I am :)
0

Have a look at the same question I posted some time ago.

The install guide says to "register" RVM in the terminal this way:

 user$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile

Basically, when you load the RVM function in your shell, where you're going to put the instruction depends on your distribution; here it's going into .bash_profile.

As a user of Ubuntu, I found using .bashrc instead of .bash_profile worked better.

The difference between .bash_profile and .bashrc is outlined here: http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

2 Comments

Thanks for responding. I tried that and it seems to not be working, although I have messed around with it so much with different people's recommendations that I am not sure if I messed it up even more. I also had checked that previous thread you mentioned. It says to remove the previous install and try again. How do I remove a previous install? Sorry for the newb questions. We have to start somewhere, right?
After issuing user$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc (note the "rc", have you tried closing and reopening your terminal window?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.