最近刚接触ruby和rails,留个笔记,记录碰到的问题(不定时更新)
资源 http://rubyforge.org/
问题使用rails2.3.4版本生成的工程,创建controller 无法被识别,于是升级rails为3.0试试,在升级中碰到问题,如下
环境ruby1.9.2p180. (on windows) gem1.7.1
1、
D:\mysql-5.0.18-win32\bin>gem install rails --version 3.0.0
Fetching: activesupport-3.0.0.gem (100%)
ERROR: While executing gem ... (Gem::FormatException)
builder-2.1.2 has an invalid value for @cert_chain
此问题是gem1.7.1的bug,网上建议使用1.6.2
>gem update --system 1.6.2
再次安装
D:\mysql-5.0.18-win32\bin>gem install rails --version 3.0.0
Fetching: i18n-0.4.2.gem (100%)
Fetching: activemodel-3.0.0.gem (100%)
Fetching: rack-1.2.2.gem (100%)
Fetching: rack-test-0.5.7.gem (100%)
Fetching: rack-mount-0.6.14.gem (100%)
Fetching: tzinfo-0.3.26.gem (100%)
Fetching: abstract-1.0.0.gem (100%)
Fetching: erubis-2.6.6.gem (100%)
Fetching: actionpack-3.0.0.gem (100%)
Fetching: arel-1.0.1.gem (100%)
Fetching: activerecord-3.0.0.gem (100%)
Fetching: activeresource-3.0.0.gem (100%)
Fetching: mime-types-1.16.gem (100%)
Fetching: polyglot-0.3.1.gem (100%)
Fetching: treetop-1.4.9.gem (100%)
Fetching: mail-2.2.15.gem (100%)
Fetching: actionmailer-3.0.0.gem (100%)
Fetching: thor-0.14.6.gem (100%)
Fetching: railties-3.0.0.gem (100%)
Fetching: bundler-1.0.11.gem (100%)
Fetching: rails-3.0.0.gem (100%)
Successfully installed builder-2.1.2
Successfully installed i18n-0.4.2
Successfully installed activemodel-3.0.0
Successfully installed rack-1.2.2
Successfully installed rack-test-0.5.7
Successfully installed rack-mount-0.6.14
Successfully installed tzinfo-0.3.26
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.0
Successfully installed arel-1.0.1
Successfully installed activerecord-3.0.0
Successfully installed activeresource-3.0.0
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.15
Successfully installed actionmailer-3.0.0
Successfully installed thor-0.14.6
Successfully installed railties-3.0.0
Successfully installed bundler-1.0.11
Successfully installed rails-3.0.0
22 gems installed
Installing ri documentation for builder-2.1.2...
Installing ri documentation for i18n-0.4.2...
Installing ri documentation for activemodel-3.0.0...
Installing ri documentation for rack-1.2.2...
Installing ri documentation for rack-test-0.5.7...
Installing ri documentation for rack-mount-0.6.14...
Installing ri documentation for tzinfo-0.3.26...
Installing ri documentation for abstract-1.0.0...
Installing ri documentation for erubis-2.6.6...
Installing ri documentation for actionpack-3.0.0...
Installing ri documentation for arel-1.0.1...
Installing ri documentation for activerecord-3.0.0...
Installing ri documentation for activeresource-3.0.0...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.1...
Installing ri documentation for treetop-1.4.9...
Installing ri documentation for mail-2.2.15...
Installing ri documentation for actionmailer-3.0.0...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for railties-3.0.0...
Installing ri documentation for bundler-1.0.11...
Installing ri documentation for rails-3.0.0...
Installing RDoc documentation for builder-2.1.2...
Installing RDoc documentation for i18n-0.4.2...
Installing RDoc documentation for activemodel-3.0.0...
Installing RDoc documentation for rack-1.2.2...
Installing RDoc documentation for rack-test-0.5.7...
Installing RDoc documentation for rack-mount-0.6.14...
Installing RDoc documentation for tzinfo-0.3.26...
Installing RDoc documentation for abstract-1.0.0...
Installing RDoc documentation for erubis-2.6.6...
Installing RDoc documentation for actionpack-3.0.0...
Installing RDoc documentation for arel-1.0.1...
Installing RDoc documentation for activerecord-3.0.0...
Installing RDoc documentation for activeresource-3.0.0...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for polyglot-0.3.1...
Installing RDoc documentation for treetop-1.4.9...
Installing RDoc documentation for mail-2.2.15...
Installing RDoc documentation for actionmailer-3.0.0...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for railties-3.0.0...
Installing RDoc documentation for bundler-1.0.11...
Installing RDoc documentation for rails-3.0.0...
安装成功
2、卸载老版本模块的方法
D:\Ruby192\tmp\mybook>gem uninstall actionmailer -v 2.2.3
Successfully uninstalled actionmailer-2.2.3
3、创建工程后rails server启动web服务
提示
找不到sqllite.dll 或
无法定位程序输入点 sqlite3_backup_finish 于动态链接库 sqlite3.dll
需下载到http://www.sqlite.org/download.html下在 放到ruby安装目录bin下
4、生成工程后浏览
Routing Error
No route matches "/MyTest/hello"
修改工程config\routes.rb文件
match ':controller(/:action(/:id(.:format)))' 此行注释去掉,又出现下一个问题见5
5、编写例子,浏览时报
undefined method `render_text'
原因rails的新版本不用render_text了,改为render:text=>"hello world"就可以了(参考了http://qyongkang.iteye.com/blog/404604)
分享到:
相关推荐
收集了常用RAILS学习的网址 收集了常用RAILS学习的网址
rails学习教程,ruby on rails入门,pdf格式,英文
Ruby on Rails 学习案例
ruby on rails 学习资料pdf
仅仅三分,就可以帮助你搭好框架,拥有学习手册。欢迎下载其他文档
Ruby On Rails是一个用于编写网络应用程序的软件包.它基于一种计算机软件语言Ruby,给程序开发人员提供了强大的框架支持.本书介绍了rails的基本使用,深入扩展,练习挺多的
NULL 博文链接:https://wikimo.iteye.com/blog/622212
包含: [大家网]Ruby.on.Rails.Web开发之旅[www.TopSage.com] ruby on rails实践 rubyonrails rubyonrails宝典 pdf格式
主要介绍ruby的开发框架ruby 的一些目录结构和框架啊源代码的应用,
NULL 博文链接:https://aideehorn.iteye.com/blog/290165
轨道学习我的 Rails 学习
学习资源 [在线 YAML 解析器](Online YAML Parser) 好文共分享 [Ruby 与多态](Polymorphism and Ruby) 书籍推荐 由于 ruby 和 rails 的版本迭代都很快,这就导致很多出版的 ruby 书籍过了几年都严重落伍,所以一定要...
Ruby on Rails Web开发学习实录 内容简介: 在目前的主流web开发技术中,基于ruby语言的rails框架是做网站开发速度最快的工具。它可以达到j2ee框架开发速度的5~10倍,并且代码量也非常少。另外由于代码量的大幅度...
Reddit帖子:我是如何从零开始学习Rails的,直到找到工作的地步 成为Ruby专家的提示 Thoughtbot免费资源: Reddit 通过在代码战中用Ruby弄脏双手来变得更好 频道和视频 图书 Rails API Mich
rails学习的好帮手 有助于初学者学习rails on ruby ,
NULL 博文链接:https://umeit.iteye.com/blog/1137388
sunspot 学习笔记-安装以及使用,另外还有部分crontab插件的安装以及使用,适用与rails3
《Ruby on rails web开发学习实录》的光盘文件
Ruby on Rails Web开发学习实录.pdf