1

I'm trying to get Foreman to work with my Unicorn setup.

Here is my Procfile:

web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb

Here is the output when I start Foreman:

10:41:37 web.1     | started with pid 19300
10:41:38 web.1     | /Users/seth/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.1.4/lib/bundler/shared_helpers.rb:2:in `require': no such file to load -- rubygems (LoadError)
10:41:38 web.1     | process terminated
10:41:38 web.1     |    from /Users/seth/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.1.4/lib/bundler/shared_helpers.rb:2
10:41:38 system    | sending SIGTERM to all processes
10:41:38 web.1     |    from /Users/seth/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.1.4/lib/bundler/setup.rb:1:in

It's failing on:

require 'rubygems'

UPDATE: After a quick sanity check by running ruby --version I realize I was actually running 1.8.7. For some reason running rvm use --default 1.9.2-p136 or even the newly installed 1.9.2-p320 does not persist after I close that terminal window. It always reverts back to 1.8.7.

So I was able to start foreman now but when I close that terminal and come back I'm back to 1.8.7, any ideas?

sethdeckard
  • 499
  • 11
  • 24

2 Answers2

0

Moving this line:

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

To the bottom of my .profile fix it for me. This helped me: Why doesn't "RVM --default" work for me on MacOSX?

Community
  • 1
  • 1
sethdeckard
  • 499
  • 11
  • 24
0

You need to be running login session to make RVM run in interactive mode - for example: https://rvm.io/integration/gnome-terminal/ or https://rvm.io/workflow/screen/

but for using RVM in scripting you should read: https://rvm.io/integration/cron/

mpapis
  • 52,729
  • 14
  • 121
  • 158