WinXP下安装activescaffold
前一阶段在WinXP 上试验 rails 2.3.4 版本的 ActiveRecord ,觉得挺好用。
今天网上看到一个activescaffold 插件,想尝试一下。 依照"activescaffold+rails2.3.4+本地化 记录" <http://www.iteye.com/topic/484236 >
第一步:windows command line在rails项目目录里里输入ruby script/plugin install git://github.com/activescaffold/active_scaffold.git 命令行马上就运行结束,跳出下一个提示符,觉得很古怪,怎么连点反馈信息都没有。 看到\vendor\plugins\下有个active_scaffold目录,打开一看是空的,晕! 去active_scaffold网站上看,貌似先要装 git, 后来一看 git好像只有 -uix,Mac OS版。找到Windows版,装完后 再次运行第一步,还是空目录,不明。折腾啊!
active_scaffold主站上就没说Windows上怎么装,google了下也不少人在问,有人说先装个Cygwin。
后来看了下已经装好的acts_as_list插件的结构,有点开窍了。 先运行 ruby script/plugin install git:XXXX 的命令,让它自动生成一个空目录。 然后人肉跑到git上找到相应url把代码下载下来,解压缩后手工copy到相应的空目录中去。
还没太整明白在 routes.rb 怎么配路由,和 map.rescources 这种路由怎么协同,官网文档上也没看到。
自己跟着官方教程写了2个文件:
- app/views/layouts/as_users.html.erb
- app/controllers/asusers_controller.rb
class AsusersController < ApplicationController
active_scaffold :user
end
Firefox里打 http://localhost:3000/asusers 页面显示出来了,感叹...不容易啊。
收获2点:
- 如何在windows下安装script/plugin git 插件。
- activescaffold for rails 2.3.4 跑起来了。
初学Rails,有什么好资源大家告诉我一声。
在2.3.5中一直出 “plugin not found"的问题。
在windows上貌似可以用这样方法安装 ruby script/plugin install http://github.com/activescaffold/active_scaffold.git/
把git:// 改成http://, 最后再加个"/" 这样就不用安装git了
有什么推荐的吗
我建议你放弃使用AcitiveScaffold,否则会带来很不好的初体验,AcitiveScaffold这个东西有很多bug,和rails各种版本兼容也有很多的问题,我前几个月尝试过,最后的结论是,为了节省后台管理的开发时间而使用AcitiveScaffold,结果可能带来更长的处理各自未知问题的时间
遇到个新问题: 安装好AcitiveScaffold后网页上可以运行 但执行rake test:units进行自动测试出错。 不知为何,难道是跟AcitiveScaffold和rails 2.3.4配合不好。 只要在自动测试时,把active_scaffold :user注释掉,就能正常运行了。
新手上路是非多啊。
详细报错LOG如下: D:/test/tdm/vendor/plugins/active_scaffold/lib/active_scaffold/configurable.rb:19:in
method_missing': undefined methodcreate' for #ActiveScaffold::Config::Core:0x38a51bc (NoMethodError)不就是为了更快更省力干完活,然后可以上网去“海阔天空”吗。
其实最近要做个WEB原型系统,大家都说ROR好,我也来试试。
tuti 大湿怎么想起来搞ROR啦? 你需要安装git(windows版),保证git能在命令行下运行,然后才可以ruby script/plugin install git://github.com/activescaffold/active_scaffold.git
还是感觉 http://rubyonrails.org/ 是最棒的资源,或者去这里淘宝 http://www.rubyinside.com/