pitluga / subcontractor

rvm aware process launcher for foreman
85 stars 24 forks source link

Issues with multiple ruby projects using rvm #4

Closed masterkain closed 12 years ago

masterkain commented 12 years ago

Hello, this is my Procfile that resides in my main project dir:

web:  bundle exec rainbows -p $PORT -c ./config/unicorn.rb
node: subcontract --chdir ../node --signal INT -- coffee application.coffee --environment development --uploader --streamer
push: subcontract --rvm "--with-rubies rvmrc" --chdir ../push --signal INT -- bundle exec slanger --app_key xxx --secret xxx --redis_address redis://127.0.0.1:6379/0

Now, ../push does use a .rvmrc like this:

rvm use --create --install ruby-1.9.2-p290@push

if ! command -v bundle ; then
  gem install bundler --no-rdoc --no-ri
fi

if ! command -v foreman ; then
  gem install foreman --no-rdoc --no-ri
fi

The issue here is that everytime I run foreman startwith this Procfilethe system will attempt to download bundler and foreman gems for the push project, sometimes only foreman, like in the example below:

18:31:13 push.1    | started with pid 26375
18:31:25 push.1    | 
18:31:25 push.1    | RVM is not a function, selecting rubies with 'rvm use ...' will not work.
18:31:25 push.1    | /Users/kain/.rvm/bin/bundle
Fetching: foreman-0.34.1.gem (100%)man-0.34.1.gem
18:31:25 push.1    | Successfully installed foreman-0.34.1
18:31:25 push.1    | 1 gem installed
18:31:25 push.1    | Unrecognized command line argument: 'bundle' ( see: 'rvm usage' )

Any idea? Thanks.

.bash_profile

[[ -s "/Users/kain/.rvm/scripts/rvm" ]] && source "/Users/kain/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
masterkain commented 12 years ago

I have now updated my .rvmrc to the latest RVM templates, just an issue is left:

push: subcontract --rvm "--with-rubies rvmrc" --chdir ../push --signal INT -- bundle exec slanger --app_key xxx --secret xxx --redis_address redis://127.0.0.1:6379/0

Results in a:

18:46:50 push.1    | Unrecognized command line argument: 'bundle' ( see: 'rvm usage' )
pitluga commented 12 years ago

You rvmrc seems to be working fine for me. I have had issues installing foreman. For me it seems the latest version of foreman has an invalid gemspec. What versions of ruby, rvm, and foreman are you using for the top-level that is launching all your projects?

swalke16 commented 12 years ago

Having the same issue as @masterkain. System info:

RVM: 1.11.3 RUBY: 1.9.3-head FOREMAN: 0.46.0

swalke16 commented 12 years ago

Changing the line to this

push: subcontract --rvm --with-rubies default-with-rvmrc do --chdir ../push --signal INT -- bundle exec slanger --app_key xxx --secret xxx --redis_address redis://127.0.0.1:6379/0

fixes the problem for me. The quotes are not needed, and the RVM command has changed.

pitluga commented 12 years ago

Thanks @swalke16 for getting to the bottom of it. I'll update the documentation.