# RVM PATH & Version Confusion

**URL:** <https://rubytalk.org/t/rvm-path-version-confusion/70657>\
**Category:** ruby-talk\
**Created:** [27 March 2015 17:16 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657 "2015-03-27T17:16:52Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [27 March 2015 17:16 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/1 "2015-03-27T17:16:52Z")

</div>

Hi folks.

Can someone show me how to properly set up my RVM path? I keep getting this while RVM seems to be set up properly. I’m pointing to 2.2.1 yet it barfs on 2.0.0 for some reason:

Warning! PATH is not properly set up, '/Users/rich/.rvm/gems/ruby-2.2.1/bin' is not at first place,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usually this is caused by shell initialization files - check them for 'PATH=...' entries,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to fix temporarily in this shell session run: 'rvm use ruby-2.2.1’.

I’ve done that and the last line in my .bash\_profile is this:

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

In fact I only have 2.2.1 installed, so I have no clue why it’s looking for 2.0.0:

HQ:rubies rich$ gem update  
/Users/rich/.rvm/gems/ruby-2.2.1/gems/psych-2.0.13/lib/psych.bundle: [BUG] Segmentation fault  
ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86\_64-darwin14]

Any help appreciated.

Cheers

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [27 March 2015 17:23 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/2 "2015-03-27T17:23:01Z")

</div>

> I’ve done that and the last line in my .bash\_profile is this:
> 
> [[-s "$HOME/.rvm/scripts/rvm"]] && source "$HOME/.rvm/scripts/rvm”

Does ~/.rvm/scripts/rvm exist?

If yes: Is there anything else that is executed after your ~/.bash\_profile has  
been sourced, e.g., in ~/.bashrc?

> In fact I only have 2.2.1 installed, so I have no clue why it’s looking for  
> 2.0.0:
> 
> HQ:rubies rich$ gem update  
> /Users/rich/.rvm/gems/ruby-2.2.1/gems/psych-2.0.13/lib/psych.bundle: [BUG]  
> Segmentation fault ruby 2.0.0p481 (2014-05-08 revision 45883)  
> [universal.x86\_64-darwin14]

Because, I guess, your system ruby (v2.0.0) is actually used (see: ruby --  
version), and I would further guess that it is because it is picked up before  
your RVM-installed ruby.

Could you please provide the output of `echo $PATH' and `which ruby'?

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Friday 27 March 2015 13:16:52, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [27 March 2015 17:38 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/3 "2015-03-27T17:38:22Z")

</div>

Thanks for the reply.

~/.rvm/scripts/rvm does indeed exist.

~/.bashrc has the single command:

export PATH="$PATH:$HOME/.rvm/bin”

ruby —version =\> ruby 2.2.1p85 (2015-02-26 revision 49769) [x86\_64-darwin14]

Here is $PATH:

/Users/rich/.rvm/gems/ruby-2.2.1/bin:/Users/rich/.rvm/gems/ruby-2.2.1@global/bin:/Users/rich/.rvm/rubies/ruby-2.2.1/bin:/Users/rich/.rvm/bin:~/.rvm:/Applications/RF\ Utilities:/Applications/RF\ Utilities/GPSBabel:/usr/local/bin:/usr/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/sbin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:~/.rvm:/Applications/RF\ Utilities:/Applications/RF\ Utilities/GPSBabel:/usr/local/bin:/usr/bin:/usr/local/mysql/bin:/usr/local/sbin:/usr/sbin:/usr/X11/bin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/local/git/bin:/usr/local/git/bin

HQ:~ rich$ which ruby  
/Users/rich/.rvm/rubies/ruby-2.2.1/bin/ruby

(I’ve since used: rvm use 2.2.1)

> **···**
>
> > On Mar 27, 2015, at 1:23 PM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:
> > 
> > On Friday 27 March 2015 13:16:52, Bee.Lists \<bee.lists@gmail.com\> wrote:
> > 
> > > I’ve done that and the last line in my .bash\_profile is this:
> > > 
> > > [[-s "$HOME/.rvm/scripts/rvm"]] && source "$HOME/.rvm/scripts/rvm”
> > 
> > Does ~/.rvm/scripts/rvm exist?
> > 
> > If yes: Is there anything else that is executed after your ~/.bash\_profile has  
> > been sourced, e.g., in ~/.bashrc?
> > 
> > > In fact I only have 2.2.1 installed, so I have no clue why it’s looking for  
> > > 2.0.0:
> > > 
> > > HQ:rubies rich$ gem update  
> > > /Users/rich/.rvm/gems/ruby-2.2.1/gems/psych-2.0.13/lib/psych.bundle: [BUG]  
> > > Segmentation fault ruby 2.0.0p481 (2014-05-08 revision 45883)  
> > > [universal.x86\_64-darwin14]
> > 
> > Because, I guess, your system ruby (v2.0.0) is actually used (see: ruby --  
> > version), and I would further guess that it is because it is picked up before  
> > your RVM-installed ruby.
> > 
> > Could you please provide the output of `echo $PATH' and `which ruby'?

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [28 March 2015 21:49 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/4 "2015-03-28T21:49:50Z")

</div>

Hello,

> ~/.rvm/scripts/rvm does indeed exist.

Good.

> ~/.bashrc has the single command:
> 
> export PATH="$PATH:$HOME/.rvm/bin”

Hm, that might at least explain the error message. ~/.bashrc and  
~/.bash\_profile are executed for different shells. See bash(8) and have a look  
at "INVOCATION". Also, read this:  
\<[http://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch&gt;\](http://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch&gt;%5C).

However, after a `rvm use', the compilation should actually succeed. Does  
`gem' also belong to the RVM ruby version? `which gem' and `gem --version'  
should give hints.

Can you post the compile logs of "gem update"?

Cheers,  
&nbsp;&nbsp;&nbsp;&nbsp;Eric

> **···**
>
> On Friday 27 March 2015 13:38:22, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [10 April 2015 03:13 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/5 "2015-04-10T03:13:26Z")

</div>

Sorry about the delay. Some emergencies on this side.

Is this for a login shell?

> Invoked as an interactive login shell, or with --login
> 
> When Bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands from the file /etc/profile, if that file exists. 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. The --noprofile option may be used when the shell is started to inhibit this behavior.

The /etc/profile file:

> # System-wide .profile for sh(1)
> 
> if [-x /usr/libexec/path\_helper]; then  
> &nbsp;&nbsp;eval `/usr/libexec/path_helper -s`  
> fi
> 
> if ["${BASH-no}" != "no"]; then  
> &nbsp;&nbsp;[-r /etc/bashrc] && . /etc/bashrc  
> fi
> 
> test -f /etc/profile.d/rvm.sh && source /etc/profile.d/rvm.sh

There is no ~/.bash\_login

The ~/.profile file:

> [[-s "$HOME/.rvm/scripts/rvm"]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session \*as a function\*

But the login would have read .bash\_profile because it takes all my aliases and directives. So when I’m asking for IRB, it shouldn’t be looking at 2.0.0 if rvm is set up properly. The new terminals/logins I get are looking to 2.0.0 for some reason, and I get crash reports indicating it’s looking for 2.0.0, including “gem update”.

Not sure where to go with this.

Cheers

> **···**
>
> > On Mar 28, 2015, at 5:49 PM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:
> > 
> > Hello,
> > 
> > On Friday 27 March 2015 13:38:22, Bee.Lists \<bee.lists@gmail.com\> wrote:
> > 
> > > ~/.rvm/scripts/rvm does indeed exist.
> > 
> > Good.
> > 
> > > ~/.bashrc has the single command:
> > > 
> > > export PATH="$PATH:$HOME/.rvm/bin”
> > 
> > Hm, that might at least explain the error message. ~/.bashrc and  
> > ~/.bash\_profile are executed for different shells. See bash(8) and have a look  
> > at "INVOCATION". Also, read this:  
> > \<[http://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch&gt;\](http://unix.stackexchange.com/questions/26676/how-to-check-if-a-shell-is-login-interactive-batch&gt;%5C).
> > 
> > However, after a `rvm use', the compilation should actually succeed. Does  
> > `gem' also belong to the RVM ruby version? `which gem' and `gem --version'  
> > should give hints.
> > 
> > Can you post the compile logs of "gem update"?
> > 
> > Cheers,  
> > &nbsp;&nbsp;&nbsp;&nbsp;Eric

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [16 April 2015 15:56 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/6 "2015-04-16T15:56:45Z")

</div>

Hey,

> Sorry about the delay. Some emergencies on this side.

hope everything went ok.

> Is this for a login shell?

Yes, basically:

login shell:: /etc/profile, ~/.bash\_profile, ~/.bash\_login, ~/.profle  
interactive shell:: ~/.bashrc

However, adding the stanza to both ~/.bash\_profile \*and\* ~/.bashrc would do  
the trick.

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

It could also be that your terminal does not start bash, but sh, in which case  
only ~/.profile would be parsed.

Be careful: If ~/.bash\_profile \*and\* ~/.profile exist, both are readable, and  
the shell is started as /bin/bash, only ~/.bash\_profile will be read.

You can check what interpreter is being run (/bin/sh or /bin/bash) by looking  
at $SHELL.

I'd check all those files and the $SHELL variable just to make sure.

> But the login would have read .bash\_profile because it takes all my aliases  
> and directives. So when I’m asking for IRB, it shouldn’t be looking at  
> 2.0.0 if rvm is set up properly. The new terminals/logins I get are  
> looking to 2.0.0 for some reason, and I get crash reports indicating it’s  
> looking for 2.0.0, including “gem update”.

If RVM is loaded correctly, it will set your ruby paths to the default ruby,  
whatever that is. You can check that with `rvm list`.

Try also executing `which` on different commands, i.e.

&nbsp;&nbsp;`which ruby`  
&nbsp;&nbsp;`which gem`  
&nbsp;&nbsp;`which irb`

Perhaps some tool is missing, and thus one from /usr/bin gets picked up.

HTH.

&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Thursday 09 April 2015 23:13:26, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [17 April 2015 12:14 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/7 "2015-04-17T12:14:51Z")

</div>

> \> I'd check all those files and the $SHELL variable just to make sure.
> 
> /bin/bash

Ok, that looks good.

> \> login shell:: /etc/profile, ~/.bash\_profile, ~/.bash\_login, ~/.profle  
> \> interactive shell:: ~/.bashrc
> 
> OK that’s where the confusion starts. The bash documentation says  
> /etc/profile first, then takes the first in order, starting with  
> ~/.bash\_profile, which I have.
> 
> Testing for both login and interactive, I found I have both. Possible? So  
> ~/.bashrc seems to be doing something I’m not wanting.

It is still unclear weather you're using an interactive or a login shell.  
Let's check that first:

&nbsp;&nbsp;[[$- == \*i\*]] && echo 'Interactive' || echo 'Not interactive'  
&nbsp;&nbsp;shopt -q login\_shell && echo 'Login shell' || echo 'Not login shell'

Next stop: The RVM error message.

I suspekt that your ~/.bashrc is sourcing ~/.bash\_profile, or vice versa. It  
could therefore be that RVM is sourced twice. Please run:

&nbsp;&nbsp;grep source ~/.bashrc ~/.bash\_profile

> > &nbsp;&nbsp;`which ruby`
> 
> Used to be outside of the .rvm directory. Now it’s fixed.
> 
> \> `which gem`
> 
> /usr/bin/gem
> 
> \> `which irb`
> 
> /usr/bin/irb
> 
> \> Perhaps some tool is missing, and thus one from /usr/bin gets picked up.
> 
> It seems the latter two are indeed just that in new sessions. Should this  
> be different?

Yes, it should basically look like this:

[eveith@basileia:~]% rvm list

rvm rubies

=\* ruby-2.1.5 [x86\_64]  
&nbsp;&nbsp;&nbsp;ruby-2.2.0 [x86\_64]

# =\> - current  
# =\* - current && default  
# \* - default

[eveith@basileia:~]% which ruby; which irb; type gem  
/home/eveith/.rvm/rubies/ruby-2.1.5/bin/ruby  
/home/eveith/.rvm/rubies/ruby-2.1.5/bin/irb  
gem is a shell function

This is what I get in a new shell session, without any priour call to RVM. I'm  
also running an interactive, but not a login shell.

We should get that PATH-related error message cleared. Check your ~/.bash\*  
files just as I wrote. If you want, you can upload them on a pastebin/github  
gist and let me have a look at it.

> Eric, thanks for the continued attention. I appreciate it.

You're welcome!

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Thursday 16 April 2015 17:28:58, you wrote:

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [17 April 2015 16:03 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/8 "2015-04-17T16:03:13Z")

</div>

> > > I'd check all those files and the $SHELL variable just to make sure.
> > 
> > /bin/bash
> 
> Ok, that looks good.
> 
> > > login shell:: /etc/profile, ~/.bash\_profile, ~/.bash\_login, ~/.profle  
> > > interactive shell:: ~/.bashrc
> > 
> > OK that’s where the confusion starts. The bash documentation says  
> > /etc/profile first, then takes the first in order, starting with  
> > ~/.bash\_profile, which I have.
> > 
> > Testing for both login and interactive, I found I have both. Possible? So  
> > ~/.bashrc seems to be doing something I’m not wanting.
> 
> It is still unclear weather you're using an interactive or a login shell.  
> Let's check that first:
> 
> &nbsp;&nbsp;[[$- == \*i\*]] && echo 'Interactive' || echo 'Not interactive'  
> &nbsp;&nbsp;shopt -q login\_shell && echo 'Login shell' || echo 'Not login shell’

Yes, that’s what I used. Here’s the output in a current bash session that is looking for 2.0.0:

ich$ [[$- == \*i\*]] && echo 'Interactive' || echo 'Not interactive'  
Interactive  
HQ:~ rich$ shopt -q login\_shell && echo 'Login shell' || echo 'Not login shell'  
Login shell

So Interactive Login shell. I am under the impression that the ~/.bashrc file is not read.

> Next stop: The RVM error message.
> 
> I suspekt that your ~/.bashrc is sourcing ~/.bash\_profile, or vice versa. It  
> could therefore be that RVM is sourced twice. Please run:
> 
> &nbsp;&nbsp;grep source ~/.bashrc ~/.bash\_profile

rich$ grep source ~/.bashrc ~/.bash\_profile  
/Users/rich/.bashrc:[[-s "$HOME/.rvm/scripts/rvm"]] && source "$HOME/.rvm/scripts/rvm"  
/Users/rich/.bash\_profile:alias sourceme="source ~/.bash\_profile"  
/Users/rich/.bash\_profile:[[-s "$HOME/.rvm/scripts/rvm"]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session \*as a function\*

So neither are sourcing eachother, but RVM is indeed sourced twice.

> > > &nbsp;&nbsp;`which ruby`
> > 
> > Used to be outside of the .rvm directory. Now it’s fixed.
> > 
> > > &nbsp;&nbsp;`which gem`
> > 
> > /usr/bin/gem
> > 
> > > &nbsp;&nbsp;`which irb`
> > 
> > /usr/bin/irb
> > 
> > > Perhaps some tool is missing, and thus one from /usr/bin gets picked up.
> > 
> > It seems the latter two are indeed just that in new sessions. Should this  
> > be different?
> 
> Yes, it should basically look like this:
> 
> [eveith@basileia:~]% rvm list
> 
> rvm rubies
> 
> =\* ruby-2.1.5 [x86\_64]  
> &nbsp;&nbsp;ruby-2.2.0 [x86\_64]
> 
> # =\> - current  
> # =\* - current && default  
> # \* - default
> 
> [eveith@basileia:~]% which ruby; which irb; type gem  
> /home/eveith/.rvm/rubies/ruby-2.1.5/bin/ruby  
> /home/eveith/.rvm/rubies/ruby-2.1.5/bin/irb  
> gem is a shell function
> 
> This is what I get in a new shell session, without any priour call to RVM. I'm  
> also running an interactive, but not a login shell.

This is what I get, with more references to RVM:

rich$ which ruby; type gem  
/Users/rich/.rvm/rubies/ruby-2.2.2/bin/ruby  
gem is a function  
gem ()  
{  
&nbsp;&nbsp;&nbsp;&nbsp;\typeset result;  
&nbsp;&nbsp;&nbsp;&nbsp;( \typeset rvmrc;  
&nbsp;&nbsp;&nbsp;&nbsp;rvm\_rvmrc\_files=("/etc/rvmrc" "$HOME/.rvmrc");  
&nbsp;&nbsp;&nbsp;&nbsp;if [[-n "${rvm\_prefix:-}"]] && ! [["$HOME/.rvmrc" -ef "${rvm\_prefix}/.rvmrc"]]; then  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rvm\_rvmrc\_files+=("${rvm\_prefix}/.rvmrc");  
&nbsp;&nbsp;&nbsp;&nbsp;fi;  
&nbsp;&nbsp;&nbsp;&nbsp;for rvmrc in "${rvm\_rvmrc\_files[@]}";  
&nbsp;&nbsp;&nbsp;&nbsp;do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[[-s "${rvmrc}"]] && source "${rvmrc}" || true;  
&nbsp;&nbsp;&nbsp;&nbsp;done;  
&nbsp;&nbsp;&nbsp;&nbsp;unset rvm\_rvmrc\_files;  
&nbsp;&nbsp;&nbsp;&nbsp;command gem "$@" ) || result=$?;  
&nbsp;&nbsp;&nbsp;&nbsp;hash -r;  
&nbsp;&nbsp;&nbsp;&nbsp;return ${result:-0}  
}

> We should get that PATH-related error message cleared. Check your ~/.bash\*  
> files just as I wrote. If you want, you can upload them on a pastebin/github  
> gist and let me have a look at it.

Yes that RVM loading happens twice:

[https://gist.github.com/daBee/d7261f1c58c06c2822ac](https://gist.github.com/daBee/d7261f1c58c06c2822ac)

> > Eric, thanks for the continued attention. I appreciate it.
> 
> You're welcome!

Cheers

Bee

> **···**
>
> > On Apr 17, 2015, at 8:14 AM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:  
> > On Thursday 16 April 2015 17:28:58, you wrote:

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [17 April 2015 16:33 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/9 "2015-04-17T16:33:50Z")

</div>

Just as an idea: rename ~/.bashrc. It doesn't seems as if you'd need it  
anyways. The additional `export PATH=...` for RVM there looks suspicious.

Afterwards, start with a fresh terminal window and have a look at `rvm list`  
as well as `which ruby`. If that looks good, try `which gem`, which should  
also return the bash function just as previously. Building an extension  
\*should\* actually succeed, then.

HTH.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Friday 17 April 2015 12:03:13, Bee.Lists \<bee.lists@gmail.com\> wrote:
> 
> > So Interactive Login shell. I am under the impression that the ~/.bashrc  
> > file is not read.
> > 
> > [...]
> > 
> > Yes that RVM loading happens twice:
> > 
> > [https://gist.github.com/daBee/d7261f1c58c06c2822ac](https://gist.github.com/daBee/d7261f1c58c06c2822ac)

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [17 April 2015 18:17 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/10 "2015-04-17T18:17:42Z")

</div>

OK, .bashrc is renamed .bashrcOLD

Here’s the output of a new terminal:

HQ:~ rich$ rvm list  
Warning! PATH is not properly set up, '/Users/rich/.rvm/gems/ruby-2.2.2/bin' is not at first place,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usually this is caused by shell initialization files - check them for 'PATH=...' entries,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to fix temporarily in this shell session run: 'rvm use ruby-2.2.2'.

rvm rubies

&nbsp;&nbsp;&nbsp;ruby-2.2-head [x86\_64]  
&nbsp;&nbsp;&nbsp;ruby-2.2.1 [x86\_64]  
=\* ruby-2.2.2 [x86\_64]

# =\> - current  
# =\* - current && default  
# \* - default

HQ:~ rich$ which ruby  
/Users/rich/.rvm/rubies/ruby-2.2.2/bin/ruby  
HQ:~ rich$ which gem  
/usr/bin/gem

I’m still getting errors on gem update

> **···**
>
> > On Apr 17, 2015, at 12:33 PM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:
> > 
> > On Friday 17 April 2015 12:03:13, Bee.Lists \<bee.lists@gmail.com\> wrote:
> > 
> > > So Interactive Login shell. I am under the impression that the ~/.bashrc  
> > > file is not read.
> > > 
> > > [...]
> > > 
> > > Yes that RVM loading happens twice:
> > > 
> > > [https://gist.github.com/daBee/d7261f1c58c06c2822ac](https://gist.github.com/daBee/d7261f1c58c06c2822ac)
> > 
> > Just as an idea: rename ~/.bashrc. It doesn't seems as if you'd need it  
> > anyways. The additional `export PATH=...` for RVM there looks suspicious.
> > 
> > Afterwards, start with a fresh terminal window and have a look at `rvm list`  
> > as well as `which ruby`. If that looks good, try `which gem`, which should  
> > also return the bash function just as previously. Building an extension  
> > \*should\* actually succeed, then.
> > 
> > HTH.
> > 
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric
> 
> Cheers
> 
> Bee

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [17 April 2015 16:51 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/11 "2015-04-17T16:51:34Z")

</div>

In fact, in ~/.bash\_profile is also an export PATH=~/.rvm... stanza. That  
isn't necessary can as as well be the source of the error message.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Friday 17 April 2015 18:33:50, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:
> 
> > On Friday 17 April 2015 12:03:13, Bee.Lists \<bee.lists@gmail.com\> wrote:  
> > \> So Interactive Login shell. I am under the impression that the ~/.bashrc  
> > \> file is not read.  
> > \>  
> > \> [...]  
> > \>  
> > \> Yes that RVM loading happens twice:  
> > \>  
> > \> [https://gist.github.com/daBee/d7261f1c58c06c2822ac](https://gist.github.com/daBee/d7261f1c58c06c2822ac)
> > 
> > Just as an idea: rename ~/.bashrc. It doesn't seems as if you'd need it  
> > anyways. The additional `export PATH=...` for RVM there looks suspicious.

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [17 April 2015 18:27 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/12 "2015-04-17T18:27:47Z")

</div>

> OK, .bashrc is renamed .bashrcOLD

And from the other e-mail I see you also removed the additional "export  
PATH=..." lines?

> rvm rubies
> 
> &nbsp;&nbsp;&nbsp;ruby-2.2-head [x86\_64]  
> &nbsp;&nbsp;&nbsp;ruby-2.2.1 [x86\_64]  
> =\* ruby-2.2.2 [x86\_64]
> 
> # =\> - current  
> # =\* - current && default  
> # \* - default
> 
> HQ:~ rich$ which ruby  
> /Users/rich/.rvm/rubies/ruby-2.2.2/bin/ruby  
> HQ:~ rich$ which gem  
> /usr/bin/gem
> 
> I’m still getting errors on gem update

Meh. ☹

Does it work after "rvm use ruby-2.2.2"?

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Friday 17 April 2015 14:17:42, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [17 April 2015 18:19 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/13 "2015-04-17T18:19:34Z")

</div>

All updated, still the following comes up on gem list:

Warning! PATH is not properly set up, '/Users/rich/.rvm/gems/ruby-2.2.2/bin' is not at first place,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;usually this is caused by shell initialization files - check them for 'PATH=...' entries,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to fix temporarily in this shell session run: 'rvm use ruby-2.2.2'.

> **···**
>
> > On Apr 17, 2015, at 12:51 PM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:
> > 
> > In fact, in ~/.bash\_profile is also an export PATH=~/.rvm... stanza. That  
> > isn't necessary can as as well be the source of the error message.
> 
> Cheers
> 
> Bee

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [17 April 2015 18:52 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/14 "2015-04-17T18:52:13Z")

</div>

> And from the other e-mail I see you also removed the additional "export  
> PATH=..." lines?

Correct.

> > rvm rubies
> > 
> > &nbsp;&nbsp;ruby-2.2-head [x86\_64]  
> > &nbsp;&nbsp;ruby-2.2.1 [x86\_64]  
> > =\* ruby-2.2.2 [x86\_64]
> > 
> > # =\> - current  
> > # =\* - current && default  
> > # \* - default
> > 
> > HQ:~ rich$ which ruby  
> > /Users/rich/.rvm/rubies/ruby-2.2.2/bin/ruby  
> > HQ:~ rich$ which gem  
> > /usr/bin/gem
> > 
> > I’m still getting errors on gem update
> 
> Meh. ☹
> 
> Does it work after "rvm use ruby-2.2.2"?

Yes. Which is strange because it doesn’t change the ruby version. So I get an error on gem update with 2.2.2, then I say “rvm use 2.2.2” then it works.

Is there a way I can restart all of this? I tried an implode before, but it didn’t change anything.

Cheers

Bee

> **···**
>
> > On Apr 17, 2015, at 2:27 PM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [17 April 2015 20:28 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/15 "2015-04-17T20:28:55Z")

</div>

> Yes. Which is strange because it doesn’t change the ruby version. So I get  
> an error on gem update with 2.2.2, then I say “rvm use 2.2.2” then it  
> works.

Yes, really strange. The only thing I could add would be: Try "rvm use 2.2.2  
--default"

> Is there a way I can restart all of this? I tried an implode before, but it  
> didn’t change anything.

Since RVM should be self-contained, deleting ~/.rvm would do the trick. Oh,  
and of course removing the RVM-dependend lines from ~/.bash\_profile.

Cheers!

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Friday 17 April 2015 14:52:13, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [17 April 2015 23:19 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/16 "2015-04-17T23:19:41Z")

</div>

> > Yes. Which is strange because it doesn’t change the ruby version. So I get  
> > an error on gem update with 2.2.2, then I say “rvm use 2.2.2” then it  
> > works.
> 
> Yes, really strange. The only thing I could add would be: Try "rvm use 2.2.2  
> —default"

That’s what I’ve been using. It gets old quickly. Heh.

> > Is there a way I can restart all of this? I tried an implode before, but it  
> > didn’t change anything.
> 
> Since RVM should be self-contained, deleting ~/.rvm would do the trick. Oh,  
> and of course removing the RVM-dependend lines from ~/.bash\_profile.

OK I erased everything, started new. It seems to be working now.

Thanks for the notes. Seems I am only half mad.

Cheers

Bee

> **···**
>
> > On Apr 17, 2015, at 4:28 PM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:  
> > On Friday 17 April 2015 14:52:13, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Eric\_MSP\_Veith](https://avatars.discourse-cdn.com/v4/letter/e/ecd19e/32.png) [@Eric\_MSP\_Veith](https://rubytalk.org/u/Eric_MSP_Veith)\
**Post date:** [18 April 2015 15:09 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/17 "2015-04-18T15:09:50Z")

</div>

> \> Yes, really strange. The only thing I could add would be: Try "rvm use  
> \> 2.2.2 —default"
> 
> That’s what I’ve been using. It gets old quickly. Heh.

Yeah. :-/

> OK I erased everything, started new. It seems to be working now.
> 
> Thanks for the notes. Seems I am only half mad.

Depends on your willpower roll. But I guess you gained at least 1d10 instanity  
points and 1d5 points corruption. 😉

Have fun with your working ruby installation!

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--- Eric

> **···**
>
> On Friday 17 April 2015 19:19:41, Bee.Lists \<bee.lists@gmail.com\> wrote:

---

<div class="post-metadata">

**Author:** ![Bee.Lists](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Bee.Lists](https://rubytalk.org/u/Bee.Lists)\
**Post date:** [18 April 2015 17:37 UTC](https://rubytalk.org/t/rvm-path-version-confusion/70657/18 "2015-04-18T17:37:58Z")

</div>

Heh, now it won’t let me require ‘mysql2'

Cheers

Bee

> **···**
>
> > On Apr 18, 2015, at 11:09 AM, Eric MSP Veith \<eveith@wwweb-library.net\> wrote:
> > 
> > Depends on your willpower roll. But I guess you gained at least 1d10 instanity  
> > points and 1d5 points corruption. 😉
> > 
> > Have fun with your working ruby installation!
