Victor
Victor

Reputation: 13378

Add columns to Rails database in production environment

I am trying to add columns to my Rails app in production environment. Can't do it in development environment on my local machine because of installation problem on some bundles.

I ran this:

sudo ruby script/generate migration add_provider_to_spots provider:string provider_price:string provider_ref:string RAILS_ENV=production

But this error pops up:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': development database is not configured (ActiveRecord::AdapterNotSpecified)
from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:438:in `initialize_database'
.
.
.

Any idea? Thanks.

Upvotes: 1

Views: 469

Answers (1)

alex.zherdev
alex.zherdev

Reputation: 24164

Try it this way

sudo RAILS_ENV=production ruby script/generate migration add_provider_to_spots provider:string provider_price:string provider_ref:string

Upvotes: 2

Related Questions