0

我正在尝试设置 redmine 并创建了一个愚蠢的简单 database.yml,如下所示:

development:
  adapter: sqlite3
  database: db/development.sqlite3
  pool: 5
  timeout: 5000

production:
  adapter: sqlite3
  database: db/production.sqlite3
  pool: 5
  timeout: 5000

当我运行rake db:create它时,它会按预期创建开发数据库。然而,当我运行rake db:migrate它失败说:

development database is not configured!

db:migrate如果database.yml配置正确到可以创建数据库,为什么我不能运行?

编辑:

我运行RAILS_ENV=development rake db:migrate并收到以下错误消息:

Invalid gemspec in [/var/lib/gems/1.8/specifications/mail-2.4.4.gemspec]: invalid date format in specification: "2012-03-14 00:00:00.000000000Z"
Invalid gemspec in [/var/lib/gems/1.8/specifications/tilt-1.3.3.gemspec]: invalid date format in specification: "2011-08-25 00:00:00.000000000Z"
NOTE: SourceIndex.new(hash) is deprecated; From /usr/share/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100 in `new'.
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
4

2 回答 2

4

尝试运行

RAILS_ENV=development rake db:migrate

您也可以使用 --trace 运行 rake 任务来找出问题

于 2012-12-27T01:38:24.850 回答
2

检查config/environment.rb您正在运行的模式。如果没有记错,redmine 默认在生产模式下运行。

于 2012-12-27T01:14:04.527 回答