0

I have deployed my rails app to Linode VPS, using capistrano but thaere is a little snag which I dont know how to solve:

Capistrano output during deployment:

==  CreateCurrencies: migrating
-- create_table(:currencies)
-> 0.0074s
==  CreateCurrencies: migrated (0.0075s)

Capistrano has created the table currencies, and I can access it on my live server.

I also have a rake task defined as follows:

namespace :rate do
  task :update => :environment do
   #Modify Currencies table.
  end
end

Now if I run

rake rate:update

On development machine: Everything works fine. On production machine: It gives the below error

rake aborted!
Could not find table 'currencies'

Any suggestions on how to solve this?

  • 1
    are you running your task on linode in the production environment? i.e. `RAILS_ENV=production rake rate:update`? It could be that you are not and that the development database on the Linode has not been migrated. – ipd Dec 21 '12 at 06:55
  • @ipd thanks. running RAILS_ENV=production rake rate:update solved the issue. –  Dec 21 '12 at 07:17

1 Answers1

0

Looks like your migartion has not worked from dev mode to production mode. Just check whether you have currencies table in your production db. Also chcek the rails_env when you do run in your production mode.

A sync of all these should fix your problem.

LPD
  • 2,833
  • 2
  • 29
  • 48