
ruby rails
Quechua
这个作者很懒,什么都没留下…
展开
-
freeBSD下配置nginx+mongrel的rails部署环境
最近准备帮朋友开发一个小型的应用,考虑再三决定使用ROR,因为朋友提供的独立主机是FreeBSD6.1,只好研究在FreeBSD下怎么安装production级别的ROR部署环境。 至于基本的软件怎么安装我这里就不多说了,网上的资源、信息很多,我这里提一下的是由于对FreeBSD不熟悉,使用ports安装的软件总是无法正确配置(还有就是可安装的软件版本太低),所以...2007-08-20 23:43:52 · 160 阅读 · 0 评论 -
linux下通过Instant Client访问oracle输出中文乱码的解决办法
1,设置NLS_LANG export NLS_LANG=american_america.AL32UTF82,在rails中database.yml的设置 development: adapter: oracle database: XXX.XXX.XXX.XXX/service_name username: your_name password: y...2008-01-03 11:10:36 · 371 阅读 · 0 评论 -
ruby学习笔记--r/w text file
1,遍历当前目录require 'find' Find.find('../../') do |f| type = case when File.file?(f) "F" when File.directory?(f) "D" else "?" ...2008-01-02 10:55:00 · 149 阅读 · 0 评论 -
ruby学习笔记--Blocks
Proc的两个使用方法ruby 代码 def some_mtd1 aproc aproc.call end some_mtd1 lambda { puts "aaaaa" } 这个代码等同于下面这个代码段ruby 代码 def some_mtd2 &bproc ...2007-12-27 20:52:34 · 237 阅读 · 0 评论 -
ruby学习笔记--Array
1,计算数字数组之和和乘积ruby 代码 class Array def inject(n) each { |value| n = yield(n,value) } n end def sum inject(0) { |n, value| n + value } ...2007-12-27 20:04:24 · 150 阅读 · 0 评论 -
ruby学习笔记--String
1,反转字符串中的单词ruby 代码 words = 'Learning Ruby - Your one stop guide' puts words.split(" ").reverse.join(" ") # guide stop one Your - Ruby Learning 如果反转中文字呢?2,判...2007-12-27 17:42:33 · 169 阅读 · 0 评论 -
ruby学习的资源
1,ruby入门的教程 http://rubylearning.com/satishtalim/tutorial.html2,国内比较好的网上资源 http://chinaonrails.com/#不断补充中2007-12-27 15:56:46 · 198 阅读 · 0 评论 -
Rails中启动script/console报错的解决办法
今天首次在Rails中启动script/console报: [root@test depot]# ruby script/console Loading development environment. /usr/local/ruby/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file ...2007-09-04 16:04:45 · 325 阅读 · 0 评论 -
CentOS下通过代理安装rails
[yourserver]# gem install rails -y --p http://youproxy:port或则[yourserver]# export http_proxy=http://youproxy:port[yourserver]# source /root/.bash_profile[yourserver]# gem install rails -y 参见: htt...2007-08-22 12:43:20 · 201 阅读 · 0 评论 -
CentOS5下安装RubyGems
我的网络只能通过代理上公网,所以首先设置代理。[root@dlxtdb ~]# vi /etc/wgetrc增加一下内容(也可以找到相应项修改)http_proxy = 192.168.71.99:8080 #192.168.71.99:8080 为代理服务器地址和端口ftp_proxy = 192.168.71.99:8080 #192.168.71.99:8080 为代理服务器...2007-08-22 11:12:18 · 164 阅读 · 0 评论 -
ruby学习笔记--Time&DateTime
1,时间的格式化输出 t = Time.now # to get day, month and year with century # also hour, minute and second puts t.strftime("%d/%m/%Y %H:%M:%S") # You can use the upper case A and B to get the full ...2008-01-04 08:42:59 · 204 阅读 · 0 评论