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
# name of the weekday and month, respectively
puts t.strftime("%A" ...
- 08:42
- 浏览 (143)
- 评论 (0)
- 分类: ruby rails
1,设置NLS_LANG
export NLS_LANG=american_america.AL32UTF8
2,在rails中database.yml的设置
development:
adapter: oracle
database: XXX.XXX.XXX.XXX/service_name
username: your_name
password: your_password
3,测试oracle是否连通:
ruby -r oci8 -e "OCI8.new( 'your_n ...
- 11:10
- 浏览 (243)
- 评论 (0)
- 分类: ruby rails
1,遍历当前目录require 'find'
Find.find('../../') do |f|
type = case
when File.file?(f)
"F"
when File.directory?(f)
"D"
else
"?"
end
puts "#{type}: #{f}"
end
...
- 10:55
- 浏览 (130)
- 评论 (0)
- 分类: ruby rails
- 浏览: 2874 次
- 性别:

- 来自: 杭州

- 详细资料
搜索本博客
最近加入圈子
最新评论
-
Rails中启动script/conso ...
补充一下,如果运行: ruby extco ...
-- by dearsuper -
ruby学习笔记--String
闰年定义成方法可以为: def leap_year(year) c ...
-- by minstrel






评论排行榜