posted on January 21, 2010

优化Rails数据库查询性能 -- rails_reviewer插件

发现一个很棒的插件 rails_reviewer插件

安装:

$ script/plugin install git://github.com/dsboulder/query_reviewer.git
$ rake query_reviewer:setup

完毕后重启server,页面左上角浮动一个SQL CRITICAL浮动窗口,里面记录页面加载时执行的所有SQL以及优化建议等。

强烈推荐 !!!

posted on January 15, 2010

rails里Mysql::Error: query: not connected

从ubuntu换回了win7后又慢慢开始折腾以前在本本上跑的一些LAMP网站, php和 mysql还是用以前的xampp里的,仍然可以用。

重装了 ruby 1.8.6, rails 2.3.5 等...发现运行rails网站,弹出messagebox提示找不到libmysql.dll尝试把mysql/bin里的dll来regsvr32,不可,直接拷贝到system32目录下错误没了,但打开网站仍然报错,终端显示“Mysql::Error: query: not connected...."

阅读剩余部分...

posted on August 29, 2009

Mysql adapter on Rails 2.3.3

安装好Ruby on Rails 2.3.3后,运行简单的页面提示如下错误“The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql”

 gem 了n次也不成,搞了一早上,才google到一个比较山寨的方法解决

1.  download older MySQL client library, for example one from InstantRails: http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll

2.  copy the downloaded file to C:\Ruby\bin (or wherever you installed Ruby) 

3. restart MySQL server

另参考:http://www.ruby-forum.com/topic/160358http://rdc.taobao.com/blog/qa/?p=523