• Home »
  • »
  • How to Start Ruby on Rails in Development Mode with LiteSpeed Web Server

How to Start Ruby on Rails in Development Mode with LiteSpeed Web Server

Starting ruby on rails in development mode with Litespeed is easy. You need to make sure that your database.yml is configured to handle development mode as well. Follow the steps below to start Litespeed running Ruby on Rails in development mode.

Please note both cofiguration settings listed in step one which include setting this to be the default for future virtual hosts and configuring current virtual hosts to restart in development mode.

  1. Modify LiteSpeed Configuration:Login to the LiteSpeed web admin console which is typically located on port 7080. Select Configuration from the top navigation menu and then choose Server from the drop down menu. This will open the Server Configuration tabs and you will need to select the last tab which is “Ruby Rails”. Click the Edit link in the top right of this configuration window and select Development from the “Rails Environment” drop down. After you have changed to Development mode select the Save link located at the top right of this window.

    **NOTE**:The above will work for new virtual hosts created after the fact but to modify an already configured LiteSpeed vhost to run in development mode you need to modify the Rails Context settings. To do this click on Configuration in the top navigation and select Virtual Hosts from the drop down. Then click the virtual host you want to start in development mode. Now click the Context tab under vhost settings and then click on Edit under the Action column of the Rails row in the Context List. Now change the Rails Environment drop down from Production to Development as shown in the below image and then click the Save link at the top right corner of the Rails Context Definition.

    Start LiteSpeed Web Server Virtual Host In Development Mode

  2. Verify Database Configurations:Now make sure that all of your Ruby on Rails virtual hosts have the proper configuration in their database.yml files. If you were running in production mode then verify there is a development mode entry as shown below in the example.

    1. development:
    2. adapter: postgresql
    3. database: db_name
    4. username: db_user
    5. password: password
    6. host: localhostproduction:
    7. adapter: postgresql
    8. database: db_name
    9. username: db_user
    10. password: password
    11. host: localhost
  3. Restart LiteSpeed:Now restart Litespeed. Make sure to do a full restart from the CLI and not a graceful restart.
  4. Verify Development Mode: Now tail the development.log file located in root/log/. You might see the development logs being logged to production.log if you have a configuration errors.

Learning Rails (Paperback)

List Price: $34.99
New From: $14.99 USD In Stock
Used from: $0.01 USD In Stock

Ruby on Rails: Up and Running (Paperback)

List Price: $29.99
New From: $2.99 USD In Stock
Used from: $0.01 USD In Stock