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.

How to deploy a Rails application?

Discussion in 'General Discussion' started by XeroCode, Mar 18, 2012.

  1. XeroCode

    XeroCode Registered

    Joined:
    Mar 10, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Hello!

    What I am trying to do is uploading and running a rails application which works fine locally. It is a simple test application.

    When I try to add a new RoR application via CPanel (Deploying a Ruby on Rails Environment), I get this error message:
    Your app is NOT installed because there was a problem. Try again or contact our support team.

    Show Details
    An unknown error was encountered when creating your rails application.


    Ideas on what's wrong and how to fix it? Cause I don't.

    ---

    I have access to SSH. When I navigate to the rails_apps directory and create a new application via SSH, the file tree is created and bundle install is run.

    cd rails_apps
    rails new testapp
    cd testapp


    What am I to do now? Obviously, a rails application created via SSH does not show up in CPanel.


    Running
    bundle install

    Results in this:

    usser@user.website.com [~/rails_apps/testapp]# bundle install
    Fetching source index for https://rubygems.org/
    Enter your password to install the bundled RubyGems to your system:
    /usr/lib/ruby/site_ruby/1.8/rubygems/format.rb:38:in `from_file_by_path': Cannot load gem at [/usr/lib/ruby/gems/1.8/cache/rake-0.9.2.2.gem] in /home/ingusser/rails_apps/testapp (Gem::Exception)
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/source.rb:77:in `fetch'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:45:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:44:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/installer.rb:8:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/cli.rb:217:in `install'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `send'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /usr/lib/ruby/gems/1.8/gems/bundler-1.0.0/bin/bundle:13
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19



    Thank you in advance!
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please post the results when running the following commands:

    Code:
    ruby -v
    gem -v
    rails -v
    gem list --local | grep -i mongrel
    whereis ruby
    whereis rails
    whereis gem
     
  3. XeroCode

    XeroCode Registered

    Joined:
    Mar 10, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Running gem list --local | grep -i mongrel did not show anything in the terminal.

    ruby -v
    ruby 1.8.7 (2009-06-08 patchlevel 173) [x86_64-linux]
    rails -v
    Rails 3.2.1
    gem -v
    1.3.7
    gem list --local | grep -i mongrel
    gem list --local

    *** LOCAL GEMS ***

    actionmailer (3.2.2)
    actionpack (3.2.2, 3.2.1)
    activemodel (3.2.2, 3.2.1)
    activerecord (3.2.2)
    activeresource (3.2.2)
    activesupport (3.2.2, 3.2.1)
    arel (3.0.2)
    builder (3.0.0)
    erubis (2.7.0)
    forem (0.0.1)
    hike (1.2.1)
    i18n (0.6.0)
    journey (1.0.2)
    mail (2.4.4)
    mime-types (1.17.2)
    multi_json (1.1.0)
    polyglot (0.3.3)
    rack (1.4.1)
    rack-cache (1.1)
    rack-ssl (1.3.2)
    rack-test (0.6.1)
    rake (0.9.2.2)
    rubygems-update (1.8.19)
    simple_form (1.5.2)
    sprockets (2.1.2)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
    tzinfo (0.3.32)
    whereis ruby
    ruby: /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1
    whereis rails
    rails: /usr/bin/rails
    whereis gem
    gem: /usr/bin/gem
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello,

    It appears that Ruby and Rails cannot have been installed using cPanel. If it were, the Rails version would be 2.3.14 and mongrel would be installed. Please do the following:

    Code:
    mv /usr/bin/ruby /usr/bin/ruby.bak
    mv /usr/lib/ruby /usr/lib/ruby.bak
    mv /usr/bin/gem /usr/bin/gem.bak
    mv /usr/bin/rails /usr/bin/rails.bak
    /scripts/installruby --force
    Moving the unsupported Ruby and Rails environment and then reinstalling using the proper cPanel script should setup the machine with the right Rails version and mongrel.

    Thanks!
     
  5. fbr76

    fbr76 Registered

    Joined:
    Dec 4, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    When I use ruby version 1.8.7 and rails version 2.3.14 it works ok. After I upgrade rails version to 3.2.3 from CPanel/Software/Module Installers/Ruby on Rails and then create application from cpanel I have same error:
    "Your app is NOT installed because there was a problem. Try again or contact our support team. An unknown error was encountered when creating your rails application."
    But for my work i need rails version higher than 3.0. What should I do?
     
    #5 fbr76, May 14, 2012
    Last edited: May 14, 2012
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you need to use Rails above 2.3.14, then you'll have to use something other than mongrel, which doesn't support Rails 3 properly. The only way I know how to get this to work would be to use the following guide:

    July 2011 - cPanel & WHM Admin Blog

    In this, you'd use mod_rails in place of mongrel. cPanel's Ruby on Rails area will no longer function for that option.

    In cPanel & WHM 11.34, we are planning to switch to mod_rails and support Rails 3 then.
     
  7. fbr76

    fbr76 Registered

    Joined:
    Dec 4, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    If I will do all steps, can I do to create application from CPanel?
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    No, you cannot as I already stated:

     
  9. fbr76

    fbr76 Registered

    Joined:
    Dec 4, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    My cPanel & WHM version 11.32. When you are planning the release of version 11.34?
     
  10. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    We have no set date for release. 11.32 is now in all tiers, though, which means work on 11.34 would reach EDGE at some point in the foreseeable future.
     
  11. marellana

    marellana Registered

    Joined:
    Jan 22, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    I have the same error, but I'm using CPanel RoR since the begining Cpanel start supporting RoR.

    root@linux [~]# ruby -v
    ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
    root@linux [~]# gem -v
    1.3.3
    root@linux [~]# rails -v
    Rails 2.3.14
    root@linux [~]# gem list --local | grep -i mongrel
    mongrel (1.1.5)
    root@linux [~]# whereis ruby
    ruby: /usr/bin/ruby /usr/lib/ruby /usr/share/man/man1/ruby.1
    root@linux [~]# whereis rails
    rails: /usr/bin/rails
    root@linux [~]# whereis gem
    gem: /usr/bin/gem

    Current Cpanel installed: WHM 11.34.1 (build 7)

    Any advices ???

    TIA
     
Loading...

Share This Page