1

现在是从我添加的 sqlite 迁移到 mysql 的时候了

gem 'mysql2'

到 Gemfile 并在此处安装它。使用 sqlite 的旧产品运行正常。当我database.yml在生产中切换到 mysql 和 mysql 服务器 DBName 和 Password 并通过 git 将其提交到服务器尝试部署时,我收到此错误:

 [out :: server] rake aborted!
 ** [out :: server] Please install the mysql adapter: `gem install activerecord-mysql-adapter` (mysql is not part of the bundle. Add it to Gemfile.)
 ** [out :: server] 
 ** [out :: server] Tasks: TOP => db:migrate => db:load_config
 ** [out :: server] (See full trace by running task with --trace)
    command finished in 9827ms

我该如何修复它或如何在服务器上安装 gem?如果我运行,bundle list我可以看到 mysql2 已安装。我必须安装哪个模块?

如果我尝试安装,我会收到错误:activerecord-mysql-adapter

ERROR:  Could not find a valid gem 'activerecord-mysql-adapter' (>= 0) in any repository
ERROR:  Possible alternatives: activerecord-jdbcmysql-adapter,
activerecord-jdbc-adapter, activerecord-jdbcmssql-adapter, activerecord-odbc-adapter,
activerecord-nulldb-adapter
4

0 回答 0