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" ...
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 ...
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 ...
Proc的两个使用方法 ruby 代码 def some_mtd1 aproc        aproc.call      end      some_mtd1 lambda { puts "aaaaa" }       这个代码等同于 ...
1,计算数字数组之和和乘积 ruby 代码 class Array    def inject(n)       each { |value| n = yield(n,value) }       n    end    def sum      inject(0)  { |n, value| ...
1,反转字符串中的单词 ruby 代码 words = 'Learning Ruby - Your one stop guide'      puts words.split(" ").reverse.join(" ")       # guide stop one Yo ...
1,ruby入门的教程 http://rubylearning.com/satishtalim/tutorial.html 2,国内比较好的网上资源 http://chinaonrails.com/ #不断补充中
今天首次在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 to load&n ...
2007-08-22

CentOS下通过代理安装rails

关键字: 代理 proxy 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 参见: http://docs.rubygems.org/read/book/2
2007-08-22

CentOS5下安装RubyGems

关键字: 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  为代理服务器地址和端口 use_proxy = on 之后执行下面的指令 [root@dlxtdb ~]# wget http://rubyforge.org ...
2007-08-20

freeBSD下配置nginx+mongrel的rails部署环境

关键字: ruby on rails nginx mongrel FreeBSD
      最近准备帮朋友开发一个小型的应用,考虑再三决定使用ROR,因为朋友提供的独立主机是FreeBSD6.1,只好研究在FreeBSD下怎么安装production级别的ROR部署环境。       至于基本的软件怎么安装我这里就不多说了,网上的资源、信息很多,我这里提一下的是由于对FreeBSD不熟悉,使用ports安装的软件总是无法正确配置(还有就是可安装的软件版本太低),所以全部源码安装最新版本的软件。最终安装组合是:Nginx+Mongrel+Rails+MYSQL。 ...
minstrel
搜索本博客
最近加入圈子
存档
最新评论