【问题标题】:rake db:seed with Rails/Spree on AppFograke db:seed 在 AppFog 上使用 Rails/Spree
【发布时间】:2013-03-20 10:49:59
【问题描述】:

我正在 appfog 上测试 Rails/Spree 应用程序,但我无法让数据库播种。 我已按照以下说明操作 T: https://docs.appfog.com/languages/ruby/rails 但是在我运行 af tunnel 然后打开一个新的终端窗口,然后运行 ​​RAILS_ENV=proxied-appfog rake db:seed 时出现错误

loading fixture /var/lib/gems/1.9.1/gems/spree_core-1.3.2/db/default/spree/countries.yml
rake aborted!
Mysql2::Error: closed MySQL connection: SET FOREIGN_KEY_CHECKS = 1

我正在使用 MySQL 作为数据库。 关于为什么会发生这种情况的任何想法?

rake:db migrate 运行时没有错误。

rake:db reset 失败并出现同样的错误。

【问题讨论】:

    标签: ruby-on-rails rake spree appfog


    【解决方案1】:

    也许你运行af tunnel,但它不完整。你必须运行一些类似af tunnel my-app-mysql-1234 然后选择 1 选项(无)

    检查我最近的回答并更改RAILS_ENV=production rake db:migrateRAILS_ENV=production rake db:seed 这样的人

    App Fog Rails Migrate Database

    它对我来说很好用。

    祝你好运!

    【讨论】:

      猜你喜欢
      • 2015-10-12
      • 2013-01-06
      • 2017-10-18
      • 2011-07-27
      • 2014-12-26
      • 1970-01-01
      • 2013-05-13
      • 2014-10-09
      • 2012-05-13
      相关资源
      最近更新 更多