The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

    Joined:
    Nov 24, 2009
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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:
    - RUBYGEMS VERSION: 1.3.7
    - 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
    - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
    - GEM PATHS:
    - /home/user/ruby/gems
    - /usr/lib/ruby/gems/1.8
    - GEM CONFIGURATION:
    - :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"
    - REMOTE SOURCES:
    - RubyGems.org | 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
    1.3.7

    $ 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')

    Rails::Initializer.run 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 Time.zone 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'

    end


    $ echo $GEM_PATH
    /home/user/ruby/gems:/usr/lib/ruby/gems/1.8

    $ echo $GEM_HOME
    /home/user/ruby/gems

    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 0.0.0.0:12002
    ** Starting Rails with development environment...
    Missing these required gems:
    wysihat-engine

    You're running:
    ruby 1.8.7.173 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.


    But;

    $ 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 0.0.0.0:12005
    ** 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 0.0.0.0:12005
    ** Use CTRL-C to stop.


    Somebody knows what's going on?

    Thanks ..
     
Loading...

Share This Page