摘要: 在此,我们要实现的是http://blueimp.github.com/jQuery-File-Upload/上传功能和效果。1.准备工作关键gem:carrierwave 和rmagick在安装rmagick这个gem之前需要安装ImageMagick和相关库ImageMagick和ImageMagick-devel,直接yum install下载关键js库函数和css http://blueimp.github.com/jQuery-File-Upload/在这里有完全的下载,jquery.iframe-transport.jsjquery.ui.widget.jsjquery.file. 阅读全文
posted @ 2012-04-20 15:23 Fcicada · Sunny 阅读(3506) 评论(1) 推荐(1) 编辑
摘要: nginx和thin的安装目标:使用同一机器中的不同端口运行不同项目,使用本机80端口访问,随机跳转到不同项目。创建简单sinatra项目,并运行起来,比如使用8001,8002,8003三个端口,ruby -rubygems myapp1.rb -p 8001ruby -rubygems myapp2.rb -p 8002ruby -rubygems myapp3.rb -p 8003例子1 ===============================upstream thin { server 127.0.0.1:8001; server 127.0.0.1:8002; server . 阅读全文
posted @ 2012-04-17 17:56 Fcicada · Sunny 阅读(825) 评论(0) 推荐(0) 编辑
摘要: 1.安装thingem install thin他会需要一下gem支持rack-0.9.1eventmachine-0.12.6daemons-1.0.10thin-1.0.0当然,他会自动安装的。2.启动和停止thin在rails项目的根目录下执行thin start -d加-d是让他能在后台运行,不加,我们停止thin的时候可以直接使用 ctrl + c。追加 “-e production”表示在生产环境下运行,追加"-p 3003"指定端口,在此指定的是3003端口thin stop停止thin3.Clusterthin start --servers 3thin s 阅读全文
posted @ 2012-04-12 11:02 Fcicada · Sunny 阅读(1696) 评论(0) 推荐(0) 编辑
摘要: 1. 首先安装一些库sudo yum install pcre-devel zlib-devel openssl-devel2. 去官网下载源码,并进行编译安装tar -xzvf nginx-1.0.14.tar.gzcd nginx-1.0.14./configure--prefix=/opt/nginx \make && make install注参数详解:--prefix #nginx安装目录,默认在/usr/local/nginx--user=nginx #运行nginx的用户--group=nginx #运行nginx的用户组--pid-path #pid问件位置,默 阅读全文
posted @ 2012-04-11 17:40 Fcicada · Sunny 阅读(780) 评论(0) 推荐(0) 编辑
摘要: This example will show you how to escape and un-escape a value to be included in a URI and within HTML.require 'cgi'# escapename = "ruby?"value = "yes"url = "http://example.com/?" + CGI.escape(name) + '=' + CGI.escape(value) + "&var=T"# url 阅读全文
posted @ 2012-04-11 11:33 Fcicada · Sunny 阅读(1169) 评论(0) 推荐(0) 编辑
摘要: centos 6.2用yum安装中文输入法1.su root2.yum install "@Chinese Support"3.exit4.回到桌面,system->preferences->input method5.如果没有,先注销一下。6.按照提示添加输入法。7.最后 再次注销,登录即可。-----------------1 2---[ali@localhost ~]$ suPassword: [root@localhost ali]# yum install "@Chinese Support"Loaded plugins: fast 阅读全文
posted @ 2012-04-02 16:46 Fcicada · Sunny 阅读(12302) 评论(0) 推荐(0) 编辑
摘要: http://www.ibm.com/developerworks/cn/web/wa-rspec/index.html#使用RSpec进行行为驱动测试http://www.letrails.cn/archives/20/ #rspec简明指南http://www.letrails.cn/archives/advanced-rspec-tutorials-rspec-scaffold/ #进阶指南(1)http://www.letrails.cn/archives/11-02-advanced-rspec-tutorials-basics/ #进阶指南(2)http://www.letrail 阅读全文
posted @ 2012-03-27 18:42 Fcicada · Sunny 阅读(168) 评论(0) 推荐(0) 编辑
摘要: http://ruby.bastardsbook.com/chapters/html-parsing/http://ruby.bastardsbook.com/chapters/web-crawling/ 阅读全文
posted @ 2012-03-22 16:00 Fcicada · Sunny 阅读(88) 评论(0) 推荐(0) 编辑
摘要: http://mechanize.rubyforge.org/ 阅读全文
posted @ 2012-03-22 15:59 Fcicada · Sunny 阅读(111) 评论(0) 推荐(0) 编辑
摘要: path是相对路径 url是绝对路径 model为复数的会对应到action=>index, 为单数时需要传递id参数并对应到action=>show如对于user而言: users_url # => http://localhost:3000/users users_path # => /users user_path(1) # => /users/1 user_url(1) # => http://localhost:3000/users/1 阅读全文
posted @ 2012-03-18 14:27 Fcicada · Sunny 阅读(452) 评论(0) 推荐(0) 编辑