1
votes

Server ubuntu 64b App using rails 3.1 database mysql

Now rails db:create works fine

Rails db:migrate done manually or through cap deploy:migration give me the following error :

rake aborted! Mysql2::Error: Table 'mywebsite_production.galleries' doesn't exist: SHOW FIELDS FROM galleries /srv/d_mywebsite/www/mywebsite/shared/bundle/ruby/1.9.1/gems/activerecord-3.1.3/lib/active_record/connection_adapters/mysql2_adapter.rb:283:in `query'

What is wrong in this deployment ?

3

3 Answers

2
votes

I just comment out the device and rails_admin routes on my config/routes.rb and everything worked out. Check if any of your routes are requiring the existence ofmywebsite_production.galleries.

0
votes

Two possible problems:

  1. While manually creating the database, you probably didn't name it properly.

  2. Or, because you said that db:create was failing, another problem could be that Rails or your database aren't set up properly and thus can't communicate with each other.

I would advice you to investigate the db:create issue first, this is likely the same thing that causes db:migrate to fail.

By creating the database yourself, all you've done is move the problem up in the stack, and once you manage to manually fix the migration issues, you might run into more problems down the road.

0
votes

can you all load all table names and check if table you created manually is present it list?

you can list table names using ActiveRecord::Base.connection.tables