Rails执行migrate时出现错误 Mysql::Error: query: not connected

D:\Rails\depot>rake db:migrate
(in D:/Rails/depot)
rake aborted!
Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version` varchar(255) NOT NULL) ENGINE=InnoDB

(See full trace by running task with --trace)
C:/Ruby186/bin/rake:19: [BUG] Segmentation fault
ruby 1.8.6 (2010-02-04) [i386-mingw32]


This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

 

Ruby是1.8.6,Rails是2.2.3,Mysql是5.1.51

出现这个问题的原因是MySQL 5.1.3及以上版本所带的libmysql.dll文件并不能很好的与Rails连接。所以你只需更换一个旧版本的libmysql.dll文件即可。

http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

到这里下载旧版本的libmysql.dll文件,将其保存在ruby\bin\目录下即可。

你可能感兴趣的:(ROR,Rails,MySQL,Ruby,SVN,C)