views:

31

answers:

1

Ive built a small application which interacts with mysql at the backend.When I run on the mongrel server its wrking fine. I want to run this application on apache server. The application is a rails application OS is opensolaris I tried to modify the httpd.conf in apache and added the follwing lines to it.

LoadModule passenger_module /var/ruby/1.8/gem_home/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
   PassengerRoot /var/ruby/1.8/gem_home/gems/passenger-2.2.15
   PassengerRuby /usr/ruby/1.8/bin/ruby

<VirtualHost *:80>
      ServerName sampleapp.com
      DocumentRoot /export/home/gaurav/test/sample_app/public
    <Directory /export/home/gaurav/test/sample_app>
      AllowOverride ALL
      Order allow,deny
      Allow from all
     </Directory>
   </VirtualHost>`

But im getting a database error. I check the log file for error its showing error code 500

A: 

You need define a production database in your db/database.yml file and create this database with all migration

RAILS_ENV=production rake db:create
RAILS_ENV=production rake db:migrate

Or if you really don't want use production environment, you can change it on your passenger configuration

shingara
Hi shingara..The RAILS_ENV=production rake db:create command worked..but when im running the next command its giving.(in /usr/home/gaurav/demo/sample_app)rake aborted!Cipher is not a module
gaurav
it's another problem. Cipher is in our Gem I suppose or your code.
shingara