soychicka
soychicka

Reputation: 68

OS X lion rvm, ruby install successfully, but doesn't execute. What am I missing?

Okie dokie - IT recently updated my system to lion, fresh install.

I followed the instructions at Federico Araujo's blog to prep for my install (http://www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/), with the exception that I used

    curl -L get.rvm.io | bash -s stable --rails 

from http://beginrescueend.com/rvm/install/ to handle the rvm/rubygems/rails install. No errors reported.

I've added

  [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM function

to my .profile, closed all windows, reopened terminal and ensured that .profile was sourced on launching terminal.

But no matter what I do, I am unable to use RVM to switch into 1.9.3 and use rails.

Nothing in path or $HOME/.rvm/scripts/rvm added to path:

    $ rvm list
    -sh: rvm: command not found

and

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

If I add $HOME/.rvm/bin to path, I can see the RVM jazz, but

    $ type rvm | head -1 
    rvm is hashed (/Users/soychicka/.rvm/bin/rvm)

And if I add $HOME/.rvm/scripts to path, and

    $ type rvm | head -1 
    rvm is /Users/soychicka/.rvm/scripts/rvm

And in the last case, issuing 'rvm list' doesn't throw an error, but simply returns a new prompt.

Again, it appears that everything compiled and installed properly; just can't get RVM to jf Ruby 1.9.3 and assorted gems into use.

What is wrong here? I've looked through all apparently relevant questions, but haven't een anything that appears to match...

This does not bode well for my attempts to open my team's eyes to the ease of prototyping with Rails...

UPDATE: Adding the following to my .profile (but not .bash_profile) appears to have resolved the issue:

    PATH=$HOME/.rvm/bin:$PATH

    if [ -s "$HOME/.rvmrc" ]; then
        source "$HOME/.rvmrc"
    fi # to have $rvm_path defined if set
    if [ -s "${rvm_path-$HOME/.rvm}/scripts/rvm" ]; then
        source "${rvm_path-$HOME/.rvm}/scripts/rvm"
    fi

But to me, it feels a bit too hacky to be comfortable, and it still isn't clear why this differs from my other lion installs... First install was in February, but attempts to set up rvm on systems last month and this following the same set of instructions failed. Anybody have ideas?

Upvotes: 1

Views: 1009

Answers (2)

soychicka
soychicka

Reputation: 68

Adding the following to my .profile (but not .bash_profile) appears to have resolved the issue:

PATH=$HOME/.rvm/bin:$PATH

if [ -s "$HOME/.rvmrc" ]; then
    source "$HOME/.rvmrc"
fi # to have $rvm_path defined if set
if [ -s "${rvm_path-$HOME/.rvm}/scripts/rvm" ]; then
    source "${rvm_path-$HOME/.rvm}/scripts/rvm"
fi

Upvotes: 2

Reactormonk
Reactormonk

Reputation: 21690

From man bash

After reading that file, it looks for ~/.bash_profile,
~/.bash_login, and ~/.profile, in that order, and reads and
executes commands from the first one that exists and is readable.

Are you sure none of the other files exist?

Also execute

source "$HOME/.rvm/scripts/rvm"

in your shell and see if it works as expected.

I hope you're aware of the security implications of piping curl output directly into bash.

Upvotes: 2

Related Questions