ruby-on-rails - Rails 应用程序部署,rake DB :migrate doesn't create table and want table to already be here to create them

标签 ruby-on-rails database migration production

服务器 ubuntu 64b 使用 rails 3.1 的应用程序 数据库mysql

现在 rails db:create 工作正常

Rails db:migrate 手动完成或通过 cap deploy:migration 给我以下错误:

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'

这个部署有什么问题?

最佳答案

我只是在我的 config/routes.rb 上注释掉设备和 rails_admin 路由,然后一切正常。检查您的任何路线是否需要存在 mywebsite_production.galleries

关于ruby-on-rails - Rails 应用程序部署,rake DB :migrate doesn't create table and want table to already be here to create them,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11135931/

相关文章:

mysql - 数据库实现以保存用户 Activity 信息

基于 $in 的 MongoDB 索引?

ios - Cloudkit 数据库在启动到 App Store 之前被清除了吗?

mysql - 如何将数据从一个 SQLite 移动到具有不同设计的 MySQL?

python - Django 迁移删除并重新添加相同的约束

python - 为什么要对 django 1.7+ 使用 __unicode__(self) 方法?

mysql - Rails 使用连接关联提取值

ruby-on-rails - 头像默认图片不显示

ruby-on-rails - 将自定义标签添加到 sanitized_allowed_tags 而不替换默认值

ruby-on-rails - rswag gem 无法识别我在 rspec 中的参数