Rails 3 Mysql问题 [英] Rails 3 Mysql Problems

查看:76
本文介绍了Rails 3 Mysql问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用mysql启动新的Rails 3 beta 4应用程序.运行OS X Snow Leopard.与Rails的先前版本相比,MySQL没有问题.但是,现在当我启动Rails 3应用程序时,在Rails index.html启动屏幕上单击关于您的应用程序环境"时,会出现以下错误:

Trying to start a new Rails 3 beta 4 app with mysql.... Running OS X Snow Leopard. WIth previous versions of Rails I have no problem with MySQL. But now when I start the Rails 3 app I get the following error when I click "About Your Application Environment" on the Rails index.html startup screen:

Mysql:Class的未定义方法'init'

undefined method `init' for Mysql:Class

推荐答案

将您的Gemfile更改为使用"mysql2",它是一种更现代的驱动程序,具有其他人提到的更好的功能.

Change your Gemfile to use 'mysql2', it's a more modern driver and has nicer features as other people have mentioned.

默认情况下,新的Rails应用程序使用mysql2 gem.

New Rails applications use the mysql2 gem by default.

这篇关于Rails 3 Mysql问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆