posted on July 24, 2010

在centos上装rubyee,passenger和memcached ,搭建rails环境

流水笔记一则.

我之前已在服务器配置了nginx,php,mysql等,现在先安装ruby企业版

cd /tmp
wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
tar -xzvf ruby-enterprise-1.8.7-2010.02.tar.gz
cd ruby-enterprise-1.8.7-2010.02
./installer

然后按照提示做

阅读剩余部分...

posted on September 24, 2009

rails中的ActiveRecord真性感!

Rails使用的ActiveRecord真性感啊,see see吧

class User < ActiveRecord::Base  
  has_many :articles  
end  
 
class Article < ActiveRecord::Base
  belongs_to :user  
end

然后执行
>> Article.find(1) 会得到延迟加载user对象的sql语句。如下:

阅读剩余部分...

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