Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

RoR app only start from commandline with config.gem "my_gem"

Discussion in 'General Discussion' started by Wim*, Dec 6, 2010.

  1. Wim*

    Wim* Registered

    Nov 24, 2009
    Likes Received:
    Trophy Points:
    I have the following issue;

    I run WHM/cPanel 11.28.52 CENTOS 5.5 i686 xenpv

    I have configured Ruby on Rails/RubyGems to enable installing private gems;

    $ gem environment
    RubyGems Environment:
    - RUBY VERSION: 1.8.7 (2009-06-08 patchlevel 173) [i686-linux]
    - INSTALLATION DIRECTORY: /home/user/ruby/gems
    - RUBY EXECUTABLE: /usr/bin/ruby
    - EXECUTABLE DIRECTORY: /home/user/ruby/gems/bin
    - ruby
    - x86-linux
    - GEM PATHS:
    - /home/user/ruby/gems
    - /usr/lib/ruby/gems/1.8
    - :update_sources => true
    - :verbose => true
    - :benchmark => false
    - :backtrace => false
    - :bulk_threshold => 1000
    - "gempath" => ["/usr/lib/ruby/gems/1.8", "/home/user/ruby/gems"]
    - "gemhome" => "/home/user/ruby/gems"
    - | your community gem host

    $ ruby -v
    ruby 1.8.7 (2009-06-08 patchlevel 173) [i686-linux]
    $ rails -v
    Rails 2.3.8
    $ gem -v

    $ cat /home/user/rails_apps/testapp/config/environment.rb
    ENV['GEM_PATH'] = '/home/user/ruby/gems:/usr/lib/ruby/gems/1.8'

    # Specifies gem version of Rails to use when vendor/rails is not present
    RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION

    # Bootstrap the Rails environment, frameworks, and default configuration
    require File.join(File.dirname(__FILE__), 'boot') do |config|
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    config.gem "wysihat-engine"

    # Set default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names.
    config.time_zone = 'UTC'


    $ echo $GEM_PATH

    $ echo $GEM_HOME

    When i $ rake gems:install as root gem's go into /usr/lib/ruby/gems/1.8 and the app runs from cPanel.

    When i $ rake gems:unpack as user the gem's go into ~/rails_apps/testapp/vendor/gems and the app runs from cPanel.

    But when i $ rake gems:install as user the gem's go into /home/user/ruby/gems but the app won't run from cPanel. ($ mongrel_rails start -dp 12001 run's the app without error)

    When i run it from cPanel i get:

    $ tail log/mongrel.log
    ** Starting Mongrel listening at
    ** Starting Rails with development environment...
    Missing these required gems:

    You're running:
    ruby at /usr/bin/ruby
    rubygems 1.3.7 at /home/user/ruby/gems, /usr/lib/ruby/gems/1.8

    Run `rake gems:install` to install the missing gems.


    $ rake gems
    (in /home/user/rails_apps/testapp)
    - wysihat-engine
    - paperclip >= 2.3.1
    - [R] activerecord
    - [R] activesupport

    and from the command line i have no trouble;

    $ mongrel_rails start -p 12005
    ** Starting Mongrel listening at
    ** Starting Rails with development environment...
    ** Rails loaded.
    ** Loading any Rails specific GemPlugins
    ** Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
    ** Rails signals registered. HUP => reload (without restart). It might not work well.
    ** Mongrel 1.1.5 available at
    ** Use CTRL-C to stop.

    Somebody knows what's going on?

    Thanks ..

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice