1

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.

Community
  • 1
  • 1
  • I put the application code in https://github.com/entropicrune/phonebook_example and the code to run it locally in https://github.com/entropicrune/phonebook_deploy – user3389408 Mar 12 '14 at 01:18
  • In addition to local execution, and deployment on Dokku, I am able to deploy this on Heroku (provided I first remove the sqlite3 dependency, and the "require 'sqlite3'" on line 6 of models.rb). Removing sqlite3 is ok, so long as you don't use a sqlite database URL. – user3389408 Mar 12 '14 at 20:14
  • Are you getting any errors on your git push? Can you see it doing a "bundle install" when you do git push? what is the specific error message you are getting? Is the code somewhere like github where others can try it and see what the issue is? –  Mar 11 '14 at 20:43
  • git push reported success for the "Ruby 1.9" gear, and it failed for the "Advanced Ruby cartridge" gear. I made some repositories, specified in a comment on the question. – user3389408 Mar 12 '14 at 01:22
  • I don't see any code here: https://github.com/entropicrune/phonebook_example –  Mar 12 '14 at 11:32
  • Sorry! Failed to push. It's there now. – user3389408 Mar 12 '14 at 19:10

0 Answers0