I'm trying to upload my Rails 3 application to real production environment. (The application works perfectly on my local machine).
When I run rails c I got the following error:
/home/misha_moroshko/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': development database is not configured (ActiveRecord::AdapterNotSpecified)
from /home/misha_moroshko/.gems/gems/activerecord-3.0.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /home/misha_moroshko/.gems/gems/activerecord-3.0.1/lib/active_record/railtie.rb:59
from /home/misha_moroshko/.gems/gems/activesupport-3.0.1/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
How should I tell Rails that it should work with the production database rather than the development one ?
Ruby on Rails recommends to create three databases - a database each for development, testing, and production environment. According to convention, their names should be − library_development. library_production. library_test.
Rails ships with a default configuration for the three most common environments that all applications need: test, development, and production.
Set the RAILS_ENV environment variable first, or pass it to the rails c command:
RAILS_ENV=production rails c
OR
rails c production
what's in your database.yml? it should have a production setting and you'll need to tell rails you want to run it in production:
rails c production
This depends greatly on the 'environment' you are deploying to. For Apache and Passenger, one would set:
# conf/passenger.conf
RailsEnv production
RackEnv production
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With