-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes, CD to a dir with .rvmrc doesn't set the Ruby version or gemset #1351
Comments
can you gist outputs of the following commands in new tab:
|
This is an issue (not a bug) with iTerm. It's spawning a new bash process with it's working directory already set, which of course never calls cd. You could fix this with something like this in your .bashrc: [[ "`pwd`" != "$HOME" ]] && [[ -f "./.rvmrc" ]] && cd . |
the other issue might be that RVM was already loaded, and every new tab is only loading interactive shell without login, rvm when sourced first time in a dir with |
Env vars (executed from a fresh tab in that directory): Using /Users/username/.rvm/gems/ruby-1.9.3-p286 with gemset xxx
✗ echo $PATH
/usr/local/heroku/bin:/usr/local/mysql/bin:/Users/username/.rvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/username/.rvm/bin
✗ echo $GEM_HOME
/Users/username/.rvm/gems/ruby-1.9.3-p286@xxx
✗ echo $GEM_PATH
/Users/username/.rvm/gems/ruby-1.9.3-p286@xxx:/Users/username/.rvm/gems/ruby-1.9.3-p286@global
✗ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-10-12 patchlevel 286) [x86_64-darwin12.2.0]
- INSTALLATION DIRECTORY: /Users/username/.rvm/gems/ruby-1.9.3-p286
- RUBY EXECUTABLE: /Users/username/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
- EXECUTABLE DIRECTORY: /Users/username/.rvm/gems/ruby-1.9.3-p286/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/username/.rvm/gems/ruby-1.9.3-p286
- /Users/username/.rvm/gems/ruby-1.9.3-p286@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://rubygems.org/
✗ which rake
/Users/username/.rvm/bin/rake My .zshrc first line is: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" Tried to add [[ "`pwd`" != "$HOME" ]] && [[ -f "./.rvmrc" ]] && cd . both before and after but it didn't help. After cd out and in, gem env shows the current gemset: ✗ cd .. && cd web
Using /Users/username/.rvm/gems/ruby-1.9.3-p286 with gemset xxx
✗ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.9.3 (2012-10-12 patchlevel 286) [x86_64-darwin12.2.0]
- INSTALLATION DIRECTORY: /Users/username/.rvm/gems/ruby-1.9.3-p286@xxx
- RUBY EXECUTABLE: /Users/username/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
- EXECUTABLE DIRECTORY: /Users/username/.rvm/gems/ruby-1.9.3-p286@xxx/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/username/.rvm/gems/ruby-1.9.3-p286@xxx
- /Users/username/.rvm/gems/ruby-1.9.3-p286@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-rdoc --no-ri"
- "update" => "--no-rdoc --no-ri"
- REMOTE SOURCES:
- http://rubygems.org/ |
check for |
YES! I changed the first export PATH=/path/to/something into export PATH=$PATH:/path/to/something in Thanks! |
We should implement Straight into RVM2 though, since it doesn't rely on any functionality from rvm1 |
@richo most of this issues can be detected at installation or runtime, we had |
It complains with the following, and I guess it should not:
|
EDIT: Fixed, sorry if I wasted anybody's time. I changed .bash_profile line 1 to: export PATH = "$PATH:$HOME/bin ... I got confused by .zshrc but that had nothing to do with it. /EDIT Hi, when I run "rvm get stable" I get this warning:
My .zshrc file reads: PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting My .bash_profile file reads: export PATH="$HOME/bin:/Users/gabriel/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/bin:/Users/gabriel/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/gabriel/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/gabriel/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin" [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session as a function Do you know where I'm going wrong? |
yes it is your export PATH="$HOME/bin:/Users/gabriel/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0/bin:/Users/gabriel/.rvm/gems/ruby-2.0.0-p247@global/bin:/Users/gabriel/.rvm/rubies/ruby-2.0.0-p247/bin:/Users/gabriel/.rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin" I would say either remove it or change to: export PATH="$PATH:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin" |
I'm also getting this message when trying "rvm get stable" in Terminal (bash):
$ echo $PATH A bit lost! Any help would be appreciated - especially in HOW I implement the change (do I literally type into the Terminal or go through and find the file/folder manually??) |
@jk47999 this bug was closed for 1.18 and I'm working now on 1.23, please open new bug with the details, please add whole output of |
YES! I changed the first export PATH=/path/to/something export PATH=$PATH:/path/to/something Thanks! |
I declare my path on multiple lines... so this is a false negative for me export PATH=$JAVA_HOME/bin: |
I will say, if your .zshrc or .bashrc has the PATH format as |
I tried based on their guidance,but issue was still existing. |
only adding export PATH =$PATH:"----------------" as suggested by @elado worked for me |
It's 2018 and I went to update the old ruby to current:
Which brought me to this issue (dated Dec 2, 2012). It is not clear to me what, if anything I need to edit. Without modifying anything after running the above, I have this:
and
Am I to understand that export PATH in .bash_profile is causing a false positive? |
Being an impatient risk-taker, I went ahead with
and
And all went well, so I guess the above can be closed. |
Good to hear :) |
I am running OS X for Apple Silicon - Mac M1, have
Taken actions to resolve it:I came across the following solution by @elado back in 2012, and I tried to change my first export PATH So, could anyone advise how I can resolve the issues (in my view) in steps number 3 and 4? |
|
It happens in several cases.
One of them is when iTerm2 new tab is set to Reuse previous session's directory, a CMD+T will create a new tab with
Using /Users/.../.rvm/gems/ruby-1.9.3-p286 with gemset xxx
But when I run any command, such as
rake -T
, I get an error that's related to missing gems.But if I run
cd .. && cd web
, it sets the version and gemset correctly.rvm list
andrvm gemset list
show the right version/gemset:Another case is when I use consular, and it fires several tabs in a row, seems like some tabs fail to set the version/gemset, randomly. As if the CD hook is either not loaded or not functioning.
This issue is quite new, it used to work before.
The text was updated successfully, but these errors were encountered: