rake abort! Rails mysql2 error: “rake aborted! Please install the mysql2 adapter…”解决方案
来源:互联网 发布:知乎白云先生最新文章 编辑:程序博客网 时间:2024/05/16 17:25
刚开始做Ruby on Rails启动第一个数据库项目就出现了这个问题。
迁移命令:
$rake db:migrate #报错
但是事有蹊跷,说说解决方案。
请打开项目根目录下的Gemfile,仔细查找,有没有下面类似的话。
gem 'activerecord-jdbcmysql-adapter'
如果有,直接注释掉
#gem 'activerecord-jdbcmysql-adapter'
正常的是不应该有这句的,至于这句是怎么来的,我觉得和Netbeans有关。不能证实。
再次迁移,再次运行成功了。
话说这个错误的来源确实不清楚。
确定是Netbeans在作怪,在使用NetBeans自带的Jruby的情况下,一但用NetBeans来建立已有源代码的Ruby on Rail项目,这个时候一加载成功,你会发现项目下面config的data.yml已经发生了变化,本来是使用sqlite数据库,使用的驱动却给你改成了jdbcmysql,这怎么可能会对。
如果要继续使用NetBeans的话,就不要再使用其自带的Jruby了,机子上重新安装一个Ruby版本。
- rake abort! Rails mysql2 error: “rake aborted! Please install the mysql2 adapter…”解决方案
- rail rake db:migrate 出现 ActiveRecord::StatementInvalid: Mysql2::Error: Native table 'performance_sch
- rake aborted!
- MySQL2
- mysql2
- mysql2
- MySQL2
- MySQL2
- mySQL2
- MySQL2
- Rails 4 - Gem::LoadError: Specified 'mysql2' for database adapter, but the gem is not loaded
- 数据迁移rake aborted
- ubuntu环境 rake aborted!
- rails 3 安装 mysql2
- Ruby on Rails 错误“Rails 4.0.0, Gemfile requires rake 10.1.0 for Rake” 解决方案
- rails 安装 ‘mysql2’ gem时的报错和解决方案
- Rails Mysql2::Error: closed MySQL connection 报错
- Rails Rake指南
- xmlInitParser和xmlCleanupParser使用详解
- Access denied for user: 'root@localhost' (Using password: YES)
- ibatis 中3种数据库的模糊查询方法
- 常用工具
- Linux下搭建Telnet和Ftp配置
- rake abort! Rails mysql2 error: “rake aborted! Please install the mysql2 adapter…”解决方案
- windows消息机制
- [翻]Why call it Apps and not Oracle ERP ?
- 最大公约数 下
- libxml2常用函数集锦之三
- lucene 3.4 contrib/facet 切面搜索
- 数据库区分大小写,数据表区分大小写
- 优化网站性能的14条准则
- IEEE 802.11 saturated and non-saturated