Problem with Bundler #268

Closed
thelucid opened this Issue Oct 8, 2012 · 6 comments

4 participants

@thelucid

I'm having a problem whereby:

bundle install --without development:test ./vendor/bundle --binstubs bin/ --deployment

is running fine (using ruby version 1.9.3-p194) i.e.

Fetching gem metadata from https://rubygems.org/.......
Installing rake (0.9.2.2) 
...
Your bundle is complete! It was installed into ./vendor/bundle

...however, rake is then refusing to work:

$ bundle exec rake -T
Could not find rake-0.9.2.2 in any of the sources
Run `bundle install` to install missing gems.

Running bundle show rake gives me:

/home/app/vendor/bundle/ruby/1.8/gems/rake-0.9.2.2

...shouldn't this be:

/home/app/vendor/bundle/ruby/1.9.3-p194/gems/rake-0.9.2.2

...seeing as I'm using 1.9.3? ...can't get it to work whatever I do.

Any suggestions appreciated (it's on CentOS where I'm having the problem).

@pseidemann

Hello,

I think this is related to #211.

Did you tried to add you bin/ directory to the PATH variable?

@thelucid

Turns out that adding [ -f ~/.bash_profile ] && source ~/.bash_profile to .bashrc makes things work. I'm not an expert on .bash* files and when they get loaded so not sure why this makes it work.

@pseidemann

Maybe this is interesting for you: ".bash_profile vs .bashrc" http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

@thelucid

Ah, thanks.

It should probably be mentioned somewhere in the readme, something like:

# .bashrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

#.bash_profile
if [ -f ~/.bashrc ]; then
   source ~/.bashrc
fi

I'm happy to submit a documentation patch.

@sgerrand

@thelucid: Perhaps referring people to a complete documentation example would be more beneficial.

@radar

.bash_profile is for login shells, which is the 99% use-case for rbenv. Please remember to always use a login shell when using rbenv.

@radar radar closed this Dec 11, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment