I'm trying to deploy a trivial application to a gear containing the "Ruby 1.9" and "PostgreSQL 9.2" packages. The deployment appears to succeed. When I point my browser to the server, I get a Passenger "Ruby (Rack) application could not be started" with error message "Could not find rake-0.9.6 in any of the sources (Bundler::GemNotFound)". Ssh and "gem install" did not not help (the gem is installed, but not where Passenger can find it - I can't move it to where Passenger wants it, because I don't have root privileges). According to Root privileges to install ruby gems on Openshift, the gem needs to be specified in my Gemfile.lock. I did that, and it didn't help. Here is my config.ru:
require 'rubygems'
require 'bundler'
$LOAD_PATH << './lib'
ENV['DATABASE_URL'] = "#{ENV['OPENSHIFT_POSTGRESQL_DB_URL']}/phone_book"
Bundler.require
require 'phone_book/controllers'
Ramaze.start(:root => Ramaze.options.roots, :started => true)
run Ramaze
Here is my Bundle.lock:
GEM
remote: https://anybody:password@some.gem.server.com/
remote: https://rubygems.org/
specs:
daemons (1.1.9)
eventmachine (1.0.3)
haml (4.0.4)
tilt
haml-contrib (1.0.0.1)
haml (>= 3.2.0.alpha.13)
innate (2012.03)
rack (~> 1.4.1)
mysql2 (0.3.15)
pg (0.17.1)
phone_book (0.0.0)
haml (= 4.0.4)
haml-contrib (~> 1.0.0)
innate (= 2012.03)
mysql2 (~> 0.3)
pg (~> 0.17)
rack (= 1.4.5)
rake (= 0.9.6)
ramaze (= 2012.04.14)
sass (~> 3.3)
sequel (~> 4.8)
sqlite3 (~> 1.3.9)
thin (~> 1.2)
rack (1.4.5)
rake (0.9.6)
ramaze (2012.04.14)
innate (>= 2012.03)
sass (3.3.0)
rake
sequel (4.8.0)
sqlite3 (1.3.9)
thin (1.6.2)
daemons (>= 1.0.9)
eventmachine (>= 1.0.0)
rack (>= 1.0.0)
tilt (2.0.0)
PLATFORMS
ruby
DEPENDENCIES
phone_book (~> 0.0)
This example works fine when I launch it on my laptop via 'rackup'. I can also deploy this into Dokku. The code does not explicitly reference Thin (that's what I wanted to use, but I don't mind Passenger).
I also tried using the "Advanced Ruby cartridge" instead, and specifying Thin ("rhc env set OPENSHIFT_RUBY_SERVER=thin -a app_name"). This time, pushing results in "CLIENT_ERROR: Failed to execute: 'control build'", with an unhelpful suggestion to "--trace" (which is not accepted by "gem push"). ssh execution of "gear postreceive --trace" seems to hang (on OS X) until I press a key, and then I get a client side stack trace. When I restart the application from the console, I get "Unable to complete the requested operation", and "[31mbundler: command not found: thin start -C ...". That's strange, it appears Thin is intended to be included in this cartridge. In any event, I did specify it in Gemfile.lock (see above), so it once again appears that the gems I'm specifying in Gemfile.lock are not being seen.