Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Sep 2007
    Posts
    19

    Default Ruby on Rails basic deployment

    Hi, I am starting to learn some of the basics of Ruby on Rails and was hoping to use my Cpanel server for the development environment to learn. I was able to follow this guide and it works:
    Getting Started with Rails

    In this guide I create the app and a MySQL database and then start the server with 'script/server' and then when going to mywebsite.com:3000 it works perfectly.

    My question is why doesn't the cpanel interface recognize the app running (or not running for that matter)? If I go to cpanel/software/services/ruby on rails there are no apps listed.

    I tried creating an app via the cpanel and it is created ok and then I can create a rewrite, but when I browse to it says 'We're sorry, but something went wrong.'

    The cpanel interface assumes that you want to use sqlite3 and I don't believe I have this installed. So I tried converting it to mysql by creating a new config/database.yml file and then running rake db:create and rake db:migrate. These ran with out error but the app running in the browser is still not functioning..

    Can anyone point me in the right direction? Thanks, Ddeo

  2. #2
    Member
    Join Date
    Oct 2006
    Location
    Penang, Malaysia
    Posts
    56

    Default

    Ddeo,

    You may try to checkout the ruby log from the apps folder.

  3. #3
    Member
    Join Date
    Sep 2007
    Posts
    19

    Default

    Hi, I checked the production.log and here are the last entries:

    Code:
    Processing ProductsController#index (for xxx.xxx.xxx.xxx at 2009-11-20 07:21:48) [GET]
      Parameters: {"action"=>"index", "controller"=>"products"}
    
    ActiveRecord::StatementInvalid (Mysql::Error: Table 'mystore.taxonomies' doesn't exist: SELECT * FROM `taxonomies` ):
      spree (0.9.2) app/controllers/application.rb:92:in `instantiate_controller_and_action_names'
      compass (0.8.17) lib/compass/app_integration/rails/action_controller.rb:7:in `process'
      /usr/lib/ruby/gems/1.8/gems/haml-edge-2.3.86/lib/sass/plugin/rack.rb:44:in `call'
    
    Rendering /home/xxx/rails_apps/mystore/public/500.html (500 Internal Server Error)
    It looks like the database is not set up? I used these commands:

    Code:
    rake db:migrate
    rake db:admin:create
    Also note, I can get the development app to run with no problem on port 3000. I am only not able to get cpanel to run on the other port: 12002

    Does anyone know how to install a rails app by command line and then have cpanel work with it correctly? Any help is appreciated. Thanks, Ddeo

  4. #4
    Member
    Join Date
    Oct 2006
    Location
    Penang, Malaysia
    Posts
    56

    Default

    ddeo,

    It appears that there is ActiveRecord::StatementInvalid error (MySQL table error) fro your apps.

    Perhaps, you may use command below to check any missing gems.
    Code:
    rake gems:install
    Secondly, check for the environment.rb file from config folder if any setting goes wrong.

  5. #5
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb Installing Ruby, Ruby Gems, and Ruby on Rails for a cPanel/WHM server

    Quote Originally Posted by ddeo View Post
    Hi, I am starting to learn some of the basics of Ruby on Rails and was hoping to use my Cpanel server for the development environment to learn. ... Can anyone point me in the right direction? Thanks, Ddeo
    To install Ruby, Ruby Gems, and Ruby on Rails for a cPanel/WHM server please refer to our official documentation as noted below:
    Ruby on Rails and cPanel/WHM
    Installing Ruby
    Deploying a Ruby on Rails Environment
    Ruby Gem Installer via WHM

    Related menu paths in cPanel/WHM:
    cPanel: Software / Services >> Ruby Gems (Ruby Gem Installer)
    cPanel: Software / Services >> Ruby on Rails (Manage Ruby on Rails Applications)
    WHM: Main >> Software >> Module Installers >> Ruby Gem [Manage] (Ruby Gem Installer)
    Last edited by cPanelDon; 11-20-2009 at 11:26 PM.

  6. #6
    Member
    Join Date
    Sep 2007
    Posts
    19

    Default

    Hi Don, thanks for your reply. I have checked out the links you sent. I am have trouble particular to the deployment of a ROR app.
    Deploying a Ruby on Rails Environment
    I follow these instructions but for some reason the rewrite does not work. It will work only with the port number. The error says:

    Code:
    The page you were looking for doesn't exist.
    
    You may have mistyped the address or the page may have moved.
    Also, I set the app to run on reboot but this also does not start automatically on reboot.

    Please let me know if there is anything I can do to debug these problems. Thanks, Dan

  7. #7
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    Quote Originally Posted by ddeo View Post
    I follow these instructions but for some reason the rewrite does not work. It will work only with the port number. The error says:
    Code:
    The page you were looking for doesn't exist.
    You may have mistyped the address or the page may have moved.
    The redirect issue is fixed in cPanel version 11.25 as detailed in the following thread and post:
    Ruby on Rails: Not Found. - cPanel Forums

    Please do not cross-post about the same issue.

    Quote Originally Posted by ddeo View Post
    Also, I set the app to run on reboot but this also does not start automatically on reboot.
    Did you run the "installruby" script?

    When installing Ruby and Ruby on Rails via our "installruby" script this will automatically create an init script:
    Code:
    # /scripts/installruby
    Please provide the output from the following two commands:
    Code:
    # stat /etc/init.d/ror
    # chkconfig --list ror
    If the init script does not exist yet, the following script will install it:
    Code:
    # /usr/local/cpanel/bin/ror_setup
    Last edited by cPanelDon; 11-23-2009 at 09:47 PM.

  8. #8
    Member
    Join Date
    Sep 2007
    Posts
    19

    Default

    Quote Originally Posted by cPanelDon View Post
    The redirect issue is fixed in cPanel version 11.25 as detailed in the following thread and post:
    Ruby on Rails: Not Found. - cPanel Forums

    Please do not cross-post about the same issue.



    Did you run the "installruby" script?

    When installing Ruby and Ruby on Rails via our "installruby" script this will automatically create an init script:
    Code:
    # /scripts/installruby
    Please provide the output from the following two commands:
    Code:
    # stat /etc/init.d/ror
    # chkconfig --list ror
    If the init script does not exist yet, the following script will install it:
    Code:
    # /usr/local/cpanel/bin/ror_setup
    Hi Don, first off, sorry for posting twice with this issue.

    I already had run:
    Code:
    # /scripts/installruby
    I just now did the ror_setup:
    Code:
    # /usr/local/cpanel/bin/ror_setup
    Here are the results from 2 commands you suggested I run:

    Code:
    # stat /etc/init.d/ror
      File: `/etc/init.d/ror'
      Size: 344             Blocks: 8          IO Block: 4096   regular file
    Device: 49h/73d Inode: 21342176    Links: 1
    Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2009-11-24 07:26:00.000000000 -0700
    Modify: 2009-11-24 07:26:00.000000000 -0700
    Change: 2009-11-24 07:26:00.000000000 -0700
    Code:
    # chkconfig --list ror
    ror             0:off   1:off   2:on    3:on    4:on    5:on    6:off
    Thanks for your help going forward. Regards, Ddeo

  9. #9
    cPanel Quality Assurance Analyst cPanelDon's Avatar
    Join Date
    Nov 2008
    Location
    Houston, Texas, U.S.A.
    Posts
    2,554
    cPanel/Enkompass Access Level

    DataCenter Provider

    Lightbulb

    Quote Originally Posted by ddeo View Post
    Code:
    # stat /etc/init.d/ror
      File: `/etc/init.d/ror'
      Size: 344             Blocks: 8          IO Block: 4096   regular file
    Device: 49h/73d Inode: 21342176    Links: 1
    Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
    Access: 2009-11-24 07:26:00.000000000 -0700
    Modify: 2009-11-24 07:26:00.000000000 -0700
    Change: 2009-11-24 07:26:00.000000000 -0700
    Code:
    # chkconfig --list ror
    ror             0:off   1:off   2:on    3:on    4:on    5:on    6:off
    Thanks for your help going forward. Regards, Ddeo
    With the "ror" init script installed and set to "on" in chkconfig as it is now, this should automatically start applicable Ruby on Rails applications upon the next system reboot.

Similar Threads & Tags
Similar threads

  1. Replies: 9
    Last Post: 11-23-2009, 09:46 PM
  2. Ruby on Rails
    By lbwd in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 11-28-2008, 01:31 PM
  3. Ruby on Rails 2.0.2
    By jrblaine in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-20-2007, 09:37 AM
  4. How to use Ruby on Rails
    By stormridermay in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-07-2007, 09:47 PM
  5. Replies: 0
    Last Post: 05-12-2006, 05:00 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube