在我的gemfile中:
group :development, :test,:production do
gem 'mysql2', '~> 0.3.16'
end
在日志中:
$ heroku run rake db:migrate
Running rake db:migrate attached to terminal... up, run.3758
rake aborted!
Gem::LoadError: Specified 'mysql' for database adapter, but the gem is not loaded. Add gem 'mysql' to your Gemfile (and ensure its version is
at the minimum required by ActiveRecord).
我添加了" cleardb"应用程序的附加组件。现在我想使用它。但是,由于我遇到上述错误,我无法迁移到数据库。
答案 0 :(得分:6)
设置DATABASE_URL
后,您需要指定使用mysql2://
代替mysql://
这样的事情:
heroku config:set DATABASE_URL='mysql2://adffdadf2341:adf4234@us-cdbr-east.cleardb.com/heroku_db?reconnect=true'