Let's Go!

发布新日志

  • ruby / ruby on rails 参考

    2011-05-05 23:23:07

    ror视频及教程推荐:   http://fsjoy.blog.51cto.com/318484/65381

    首届中国Ruby技术大会资料 http://www.iteye.com/wiki/rubyconf/1709-first-rubyconf-china-information

    Ruby on Rails 和 J2EE 比较:http://blackanger.blog.51cto.com/140924/22444

    http://blackanger.blog.51cto.com/140924/22394

     

    视频教程下载:

    railscast

    《Lynda.com出品Ruby on Rails 3 基础培训视频课程》(LYNDA.COM RUBY ON RAILS 3 ESSENTIAL TRAINING)[光盘镜像]

    http://www.verycd.com/topics/2860989/

    《Ruby on Rails 3 网络编程视频教程》(Ruby on Rails 3 Tutorial LiveLessons Bundle)[光盘镜像]

    http://www.verycd.com/topics/2889837

     

    other:

    http://blackanger.blog.51cto.com/140924/24924

    http://blackanger.blog.51cto.com/140924/23166

    http://blackanger.blog.51cto.com/140924/43730

  • itEYE上的ROR资源列表

    2011-05-03 16:32:01

    转自:http://www.iteye.com/topic/33776

    来源于  Ruby On Rails 中文社区论坛

    <入门级教程>
    Ruby On Rails入门的中文教材
    http://www.railscn.com/viewtopic.php?t=8&sid=7558f51c768090c52947e01c1dc8885c

    Rolling with Ruby on Rails.chm入门级教程下载
    http://www.railscn.com/viewtopic.php?t=557&sid=7558f51c768090c52947e01c1dc8885c

    RubyCourse_1.0-1.pdf
    http://www.railscn.com/viewtopic.php?t=562&sid=7558f51c768090c52947e01c1dc8885c

    <综合教程>---推荐
    Rails Recipes
    http://www.railscn.com/viewtopic.php?t=634&sid=7558f51c768090c52947e01c1dc8885c

    Ruby for Rails
    http://www.railscn.com/viewtopic.php?t=620&sid=7558f51c768090c52947e01c1dc8885c

    Best of Ruby Quiz
    http://www.railscn.com/viewtopic.php?t=498&sid=7558f51c768090c52947e01c1dc8885c

    Agile Web Development with Rails
    英文版教程http://www.railscn.com/viewtopic.php?t=163&sid=7558f51c768090c52947e01c1dc8885c
    中文版教程http://my4java.itpub.net/category/9983/23097
    省墨打印版http://www.railscn.com/viewtopic.php?t=542&sid=7558f51c768090c52947e01c1dc8885c

    Ruby Hacking Guide
    http://www.railscn.com/viewtopic.php?t=565&sid=7558f51c768090c52947e01c1dc8885c

    Enterprise Integration with Ruby
    http://www.railscn.com/viewtopic.php?t=539&sid=7558f51c768090c52947e01c1dc8885c

    Programming Ruby 2nd edition
    http://www.railscn.com/viewtopic.php?t=115&sid=e9def3ef4bbbeafb16bcb8c8da5931f0

    Ruby In A Nutshell
    http://www.railscn.com/viewtopic.php?t=143&sid=7558f51c768090c52947e01c1dc8885c


    <实例教程>
    Flex 和 ROR 结合应用的教程
    http://www.railscn.com/about660.html

    一个结合flash,rails和ajax一起的购物车程序(教程)
    http://www.railscn.com/viewtopic.php?t=639&sid=7558f51c768090c52947e01c1dc8885c

    12个顶尖实例
    http://oio.zzdragon.name/?p=98

    高级Rails ajax教程
    http://www.railscn.com/viewtopic.php?t=621&sid=1777733ef6a90f744b9fdc3361c81d96


    <手册>
    rails1.1新特性介绍
    http://www.railscn.com/viewtopic.php?t=522&sid=7558f51c768090c52947e01c1dc8885c

    rails 1.1 api chm
    http://www.railscn.com/viewtopic.php?t=552&sid=7558f51c768090c52947e01c1dc8885c

    Ruby-Library-QuickRef
    http://www.railscn.com/viewtopic.php?t=564&sid=7558f51c768090c52947e01c1dc8885c

    Understanding Ruby's Object Model
    http://www.railscn.com/viewtopic.php?t=563&sid=7558f51c768090c52947e01c1dc8885c

    <论坛>
    http://www.railscn.com
    http://chinaonrails.com
    http://forum.javaeye.com
    http://rorwiki.hellopen.net

    <博客>
    铁道播客:有诸多视频教程
    http://rorcast.blogger2blogger.com/

    my4java的文字博客:有很多教程的译稿、笔记等
    http://my4java.itpub.net/

    cnruby道喜技术日记:众多实例教程
    http://www.hhtong.com/blog1/

    caphe的博客
    http://www.blogjava.net/cap

    Caiwangqin的博客
    http://www.uuzone.com/blog/uu_1115110/

    <工具使用>
    rails的IDE讨论
    http://www.railscn.com/viewtopic.php?t=3&sid=7558f51c768090c52947e01c1dc8885c

    rails的IDE讨论另一篇
    http://www.railscn.com/viewtopic.php?t=510&sid=7558f51c768090c52947e01c1dc8885c

    JEDIT与ror的讨论
    http://www.railscn.com/viewtopic.php?t=518&sid=7558f51c768090c52947e01c1dc8885c

    komodo
    http://www.railscn.com/viewtopic.php?t=310&sid=7558f51c768090c52947e01c1dc8885c

    dreamweaver的可下rubyweaver
    http://www.railscn.com/viewtopic.php?t=451&sid=7558f51c768090c52947e01c1dc8885c


    <环境设置>
    ROR with Lighttpd+SCGI on Windows
    http://www.railscn.com/viewtopic.php?t=348&sid=7558f51c768090c52947e01c1dc8885c

    ROR with Lighttpd问题
    http://www.railscn.com/viewtopic.php?t=618&sid=7558f51c768090c52947e01c1dc8885c

    lighttpd+scgi 多域名配置
    http://www.railscn.com/viewtopic.php?t=471&sid=7558f51c768090c52947e01c1dc8885c

    大负荷下apache+fastcgi出错问题,
    http://www.railscn.com/viewtopic.php?t=589&sid=7558f51c768090c52947e01c1dc8885c

    装fastCGI+MySQL驱动时候的问题
    http://www.railscn.com/viewtopic.php?t=566&sid=7558f51c768090c52947e01c1dc8885c

    typo的安装问题
    http://www.railscn.com/viewtopic.php?t=633&sid=7558f51c768090c52947e01c1dc8885c

    Getting start rails' - 在DreamHost上建Typo
    http://www.railscn.com/viewtopic.php?t=377&sid=7558f51c768090c52947e01c1dc8885c

    ROR性能测试
    http://www.railscn.com/viewtopic.php?t=454&sid=7558f51c768090c52947e01c1dc8885c

    Memcache-client for Ruby On Rails
    http://www.railscn.com/viewtopic.php?t=394&sid=7558f51c768090c52947e01c1dc8885c

    <空间申请>
    free hosting ROR
    http://www.railscn.com/about703.html

    HostingRail.com - 免费Ruby on Rails空间
    http://www.railscn.com/viewtopic.php?t=628&sid=7558f51c768090c52947e01c1dc8885c

    免费的webhosting-ror 100mb
    http://www.railscn.com/viewtopic.php?t=504&sid=7558f51c768090c52947e01c1dc8885c

    国内的Ruby on Rails空间
    http://www.railscn.com/viewtopic.php?t=285&sid=7558f51c768090c52947e01c1dc8885c


    <真实应用>
    中文站点
    http://www.railscn.com/about670.html
    http://www.railscn.com/viewtopic.php?
    http://www.railscn.com/about337.html
    外国站点
    http://www.railscn.com/viewtopic.php?t=505&sid=7558f51c768090c52947e01c1dc8885c


    <杂类>
    框架比较J2EE, Rails, Zope(and more..) 视频
    http://www.railscn.com/viewtopic.php?t=641&sid=7558f51c768090c52947e01c1dc8885c

    groovy on rails
    http://www.railscn.com/viewtopic.php?t=599&sid=7558f51c768090c52947e01c1dc8885c

    用户登录引擎(共两部分)
    http://www.railscn.com/viewtopic.php?t=434&highlight=login&sid=6d906cbcb22afe0eda158d772b0a72c2
    http://www.railscn.com/viewtopic.php?t=435&highlight=login&sid=6d906cbcb22afe0eda158d772b0a72c2

    如何开启一个后台任务?railscron
    http://www.railscn.com/viewtopic.php?t=623&sid=7558f51c768090c52947e01c1dc8885c

    如何上传一个文件
    http://www.railscn.com/viewtopic.php?t=635&sid=7558f51c768090c52947e01c1dc8885c

    如何更改首页
    http://www.railscn.com/viewtopic.php?t=409&sid=7558f51c768090c52947e01c1dc8885c

  • ruby其他

    2011-05-03 16:30:18

     

    Rails的一键环境配置程序:
    Instant Rails - Windows Instant Rails 2.0 

    Instant Rails is a one-stop Rails runtime solution containing Ruby, Rails, Apache, and MySQL, all pre-configured and ready to run.
    No installer, you simply drop it into the directory of your choice and run it. It does not modify your system environment.

    http://www.cnblogs.com/chenkai/archive/2010/07/07/1773119.html

     

    ------------------------------------------------------------------------------------------------------------------------------------

    ruby版本下载:
    http://www.ruby-lang.org/zh_cn/downloads/

    linux ror安装:
    http://blogold.chinaunix.net/u3/117244/showart_2284853.html

     

    三、安装sqlite3-ruby

    通过上面两步,sqlite3.exe和sqlite3.dll已经安装到了我们的系统路径中,下面可以安装sqlite3的Ruby接口了。RubyGems上面已经有了这样的接口库,因此:

      D:\>gem install sqlite3-ruby --include-dependencies

    很easy吧,现在写个测试程序吧:

    # test.rb
    require 'sqlite3'

    db = SQLite3::Database.new( "test.db" )
    db.execute( "select * from Movies" ) {|row| p row}
    db.close

    运行一下试试吧!

    ps: 用惯了MySQL,玩玩sqlite还是挺不错的。

     

  • 配置ruby环境及第一次ROR之旅

    2011-05-03 16:23:01


    版本信息(很重要)
    Ruby:1.8.7
    Rails:2.3.4
    sqlite3-ruby-1.2.3-mswin32.gem


    配置ror开发环境:
    1. ruby install:
    http://rubyforge.org/frs/?group_id=167&release_id=45627
    下载:rubyinstaller-1.9.2-p180.exe
       rubyinstaller-1.8.7-p334.exe (建议选这个,老版本,稳定兼容性好)
    双击进行安装,该勾选的勾选上。
    D:\script\ruby>ruby -v
    ruby 1.8.7 (2011-02-18 patchlevel 334) [i386-mingw32]

    2.下载rails:
    http://rubyforge.org/projects/rails/
    安装:放置目录,cmd下执行命令: gem install rails
    D:\script\ruby>rails -v
    Rails 2.3.4


    第一次ROR之旅
    1、创建一个rails目录
    rails mybook

    2、进入 mybook 目录。运行 ruby script\server
    这条命令是运行 script. 目录下的 server 命令来启动 webrick 服务器

    3、打开浏览器 ,输入网址http://127.0.0.1:3000/
    如果不出意外应该可以看到一个ROR的页面

    4、编辑 controller 类
    打开新的 DOS 命令行,运行 ruby script\generate controller MyTest
    c:\ruby\work\mybook\app\controllers 目录中将生成一个包含 MyTestController 类定义骨架的名为 my_test_controller.rb 的文件   c:\ruby\work为我的工作路径
    鼠标右键点击此文件,选择”edit” 打开编辑此文件
    class MyTestController < ApplicationController
      def index
        render_text "Hello world"
        end
    end

    在浏览器中访问 http://127.0.0.1:3000/My_Test/,
    这下好了,错误来了

    5. 错误一:no such file to load -- sqlite3
    出现原因:新版本的rails,默认是和sqlite3绑定的,当然需要装sqlite3-ruby数据库连接驱动了,

    6. 错误二:sqlite3 library to be found
    原因:windows环境下缺少   sqlite3 动态库
    解决:
    (1) 首先下载附件中的rar包 sqlite3.rar(535 KB),包里一共有6个文件,将它们全部解压缩到你ruby的bin目录中,假设你的ruby安装在了c盘,
    那么这个目录就应该是 c:\ruby\bin

    (2) 接下来 开始->运行->CMD

    在命令提示符里面敲 gem  install -l c:\ruby\bin\sqlite3-ruby-1.2.3-mswin32.gem 回车

    看到下面的提示

    C:\>gem install -l c:\ruby\bin\sqlite3-ruby-1.2.3-mswin32.gem
    Successfully installed sqlite3-ruby-1.2.3-x86-mswin32
    1 gem installed
    Installing ri documentation for sqlite3-ruby-1.2.3-x86-mswin32...
    Installing RDoc documentation for sqlite3-ruby-1.2.3-x86-mswin32...

    说明你安装sqlite3-ruby成功了

    注意:
    有人说是:sqlite3-ruby最新版不支持windows,装个老版本的就行了
    gem install sqlite3-ruby --version 1.2.3
    不用试了,版本之间确实有差别,就用这个,没问题。
    有说1.9.2和sqlite3之间的兼容有问题。

    附其他下载地址:
    下载:sqlite3   (不是sqlite)
    下载SQLite3安装包,应该包含三个文件,sqlite3.exe, sqlite3.def和sqlite3.dll,把这三个文件都放在ruby/bin目录下
    http://www.sqlite.org/download.html
    --> Precompiled Binaries For Windows
    sqlite-shell-win32-x86-3070600.zip     ---------->    sqlite3.exe
    sqlite-dll-win32-x86-3070600.zip       ---------->    sqlite3.dll , sqlite3.def     

    下载:sqlite3-ruby  ---> sqlite3-ruby-1.3.1.gem
    地址: http://rubyforge.org/frs/?group_id=254&release_id=44105
    安装 gem install sqlite3-ruby-1.2.3-mswin32.gem
    ###注意:不是这个:sqlite-ruby

     


    7.上面修改完毕,再刷新页面::

    错误三:NoMethodError in My testController#index
    undefined method `render_text' for #<MyTestController:0x37c8d48>
    RAILS_ROOT: C:/ruby/work/mybook
    app/controllers/my_test_controller.rb:3:in `index'
    原因:rails版本支持的问题
    解决:
    将class MyTestController < ApplicationController
      def index
        render_text "Hello world"
        end
    end

    render_text 是废弃用法,Rails在1.2.6 会给出废弃提示,而在2.x版中会去掉这些废弃方法的兼容,以保持代码的简练。


    修改为:class MyTestController < ApplicationController
      def index
            render:text=> "Hello world"
      end
    end

    修改完毕后再刷新,可以成功返回:Hello world


    在此过程中可以查看log\development.log
      Status: 500 Internal Server Error
      no such file to load -- sqlite3

    启动server:
    ruby script\server

    generate生成controller,然后编辑之:
    ruby script\generate controller MyTest
     
     
    ruby相关项目下载总站:
    http://rubyforge.org/

    参考:
    1. http://xuxiangpan888.iteye.com/blog/266696
    2. http://www.51testing.com/index.php?uid-202848-action-viewspace-itemid-235545

     

  • 最详细的Ruby on Rails安装步骤(转载)

    2011-05-03 16:19:27

    和我刚才看的文章差不多,感觉应该算是很不错的.

    最详细的Ruby on Rails安装步骤

      本文介绍了Ruby on Rails的详细安装步骤。文中使用的Ruby on Rails版本是1.8.6-26。安装Ruby之后安装Rails,然后就可以创建Web应用,并在本地测试了。

      1、安装ruby

      不用说 是下载安装包:http://rubyforge.org/frs/?group_id=167,注意版本---害人不浅,后面会说到,我下的是1.8.6-26
      http://rubyforge.org/frs/?group_id=167&release_id=45627

      装完后,可以用ruby -v 测试是否安装成功,如图,要是出现了版本 就说明安装成功了

      安装ruby 

      2、ruby安装完成后,安装rails
      http://rubyforge.org/projects/rails/

      在命令行下运行 gem install rails,会有四五个提示 一路Y,安装完后,依旧可以用rails -v, 来检测rails 是否安装成功

      安装rails 

      3、创建Web应用

      还是命令行下输入 rails testweb,比如当前的路径是 C:\Documents and Settings\Administrator>rails testweb,便会在C:\Documents and Settings\Administrator下创建一个testweb文件夹。

      创建Web应用 

      创建Web应用 

      PS:这里是可以加路径的 比如 rails C://test,具体可以看官方API:http://api.rubyonrails.org/

      4、在当前目录(testweb)下,运行 ruby script\server 启动服务,关于webrick服务器更多的信息可以访问 http://www.webrick.org/

      启动服务 

      5、浏览器中输入http://localhost:3000/,如果看到以下页面,说明OK

      浏览器中输入 

      6、写一个HelloWorld的Web程序,ruby script\generate controller HelloWorld命令

      写一个HelloWorld的Web程序 

      然后找到hello_world_controller.rb

      找到hello_world_controller.rb 

      输入以下代码,保存

      1. class HelloWorldController < ApplicationController  
      2.   def index     
      3.     render:text=>"hello world" 
      4.   end    
      5. end 

      我曾经用 render_text "Hello RoR World"   试了半天也不管用,搜了半天才发现是版本的问题,经验啊

      在浏览器中打开http://localhost:3000/hello_world,就会看见结果

      结果 

      PS:初学的一点点记录,还希望rails高手能指点一二.

      1、或许有的朋友跟我一样 看不到hello world,查看日志,出现如下错误

      Status: 500 Internal Server Error
      no such file to load -- sqlite3

      这是由于没有装sqlite3数据库,http://files.cnblogs.com/geek007/sqlite3.rar 这里下载,

      然后解压到ruby的bin目录:D:\ruby\bin,命令行执行:gem install "D:\ruby\bin\sqlite3-ruby-1.2.3-mswin32.gem"

      2、推荐一个cmd工具PowerCmd,用来替换系统的cmd,你会感觉很方便的。

     

     

Open Toolbar