Search code examples
ruby-on-rails-3rvmbundlersporkguard

Guard complaints about running outside of Bundler, but only on 2nd terminal window onwards


I am following Michael Hartl's tutorial and ran this 2 blocks of code

$ rvm get head && rvm reload
$ chmod +x $rvm_path/hooks/after_cd_bundler

$ cd ~/rails_projects/sample_app
$ bundle install --without production --binstubs=./bundler_stubs

now when I run Guard on my first terminal window everything is fine, but when I open another terminal window and run the exact same command, it complaints that I am running Guard outside of Bundler. Why is that so?

Still can't post images but here is the screenshot of the 2 separate terminal windows terminal 1 terminal 2

Thanks! Ryan


Solution

  • tests

    1. rvm current - is the proper ruby selected
    2. echo $PATH - first position should be path to .../bundler_stubs

    solutions

    1. for both errors it might work again with cd . - but this might be problematic

    2. you need to make sure that RVM was loaded properly, and that proper ruby was loaded in session:

    3. make sure you do not overwrite PATH after RVM was loaded in your RC scripts