有些东西忘的太快了 。 mysql 不知道安装过多少次 ,最终有些命令总是丢三落四的 。 最终 一个文档 把它全部终结 。
首先 安装 状态机 state_machine
安装地址:http://github.com/pluginaweek/state_machine/tree/master
这个状态机 已经被 aasm 取代 ,建议安装后者 。 我这里 需求简单 ,仅仅是记录用户的验证状态 ,无所谓了 。
安装 rspec
地址:http://wiki.github.com/dchelimsky/rspec/rails
Rspec 的安装方法在:http://wiki.github.com/dchelimsky/rspec/rails 说的很明白.可是我也遇到了问题 :
我在window上 直接按照 如下方法安装
ruby script/plugin install git://github.com/dchelimsky/rspec.git -r 'refs/tags/1.2.6'
ruby script/plugin install git://github.com/dchelimsky/rspec-rails.git -r 'refs/tags/1.2.6'
ruby script/generate rspec
结果失败 , 最后无奈 只能用 git clone 拷贝 源码到plugin下, 最后 执行
ruby script\generate rspec 才成功 。
一般情况 , 按照 以上的步骤应该没问题才对 。
安装 restful-authentication
地址:http://github.com/technoweenie/restful-authentication/tree/master
如果以上 准备就行 ,按照 这个插件里面的README.textile 安装 应该没问题了:
./script/generate authenticated user sessions \
--include-activation \
--stateful \
--rspec \
--skip-migration \
--skip-routes \
--old-passwords
我将 --skip-migration \ --skip-routes \ 去掉了 , 生成migration吧 不行的话,省了手工建文件 。