MCB
MCB

Reputation: 2073

rvm on OS 10.9 a few problems: second export path to .bash_profile, missing 2.0 path, and missing files

1)

I have this error every time I load a new bash terminal

-bash: /etc/profile.d/sm.sh: No such file or directory
-bash: /etc/profile.d/rvm.sh: No such file or directory

I saw this previously asked question with the answer to simply delete the references from .bashrc. But the answer is unaccepted and unvoted and the references to these files are not in .bashrc but in ~/etc/profile

I should note that I don't have a profile.d directory under /etc. I have files profile and profile~orig

2)

RVM added a second export path after I ran rvm get stable, but did not include a reference to Ruby 2.0.0 in either.

.bash_profile

export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH=/usr/local/bin:/Users/mcb/.rvm/gems/ruby-1.9.3-p448/bin:/Users/mcb/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/mcb/.rvm/rubies/ruby-1.9.3-p448/bin:/Users/mcb/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

My instinct is to combine them into one, eliminate repeats, and add the references to ruby 2 manually. I also added the $PATH: myself, since that didn't work the first time either.

3)

This is clearly not right

my-macbook-pro:~ mcb$ rvm get sable --auto-dotfiles
Warning! PATH is not properly set up, '/Users/mcb/.rvm/gems/ruby-2.0.0-p247/bin' is not available,
         usually this is caused by shell initialization files - check them for 'PATH=...' entries,
         it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
         to fix temporarily in this shell session run: 'rvm use ruby-2.0.0-p247'.
cat: /Users/mcb/.rvm/help/get: No such file or directory

So, long story short I'm starting to get worried about trying to fix anything else myself without some sort of guidance for fear of just making things worse.

Upvotes: 2

Views: 386

Answers (2)

mpapis
mpapis

Reputation: 53158

for 1) check /etc/profile for those two files references

for 2) remove export PATH=/usr/local/bin:/Users/mcb/.rvm/gems/ruby-1.9.3-p448/bin:/Users/mcb/.rvm/gems/ruby-1.9.3-p448@global/bin:/Users/mcb/.rvm/rubies/ruby-1.9.3-p448/bin:... from ~/.bash_profile

for 3) rvm get sable => rvm get stable

Upvotes: 3

fsaravia
fsaravia

Reputation: 735

I think the problem is that you are adding ruby 1.9.3 explicitly in your PATH, and that's a job that rvm shoud do.

In my case I have no direct reference to any of the ruby installations in my PATH.

Try cleaning your path from anything ruby and rvm related, and let rvm load as a function. This is the .bash_profile on my computer (with rvm and brew working):

export PATH=/usr/local/bin:/usr/local/sbin:$PATH:/usr/local/opt/ruby/bin
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

To check if rvm is correctly configured you can run:
type rvm | head -n 1

The result should be: "rvm is a function"

Checkout rvm official webpage for more details on how it works: https://rvm.io/rvm/install

Upvotes: 1

Related Questions