I’m using rvm on Mac OS X Snow Leopard.
ree-1.8.7-head with rails 2.3.8:
ree-1.8.7-head > require ‘rubygems’
=> true
ree-1.8.7-head > require ‘active_support’
=> true
ree-1.8.7-head > [1,2,3].rand
DEPRECATION WARNING: Array#rand is deprecated and will be removed in
Rails 3. Use “random_element” instead. (called from irb_binding at
(irb):6)
=> 2
That’s OK. Now ruby-1.9-2-p0 with rails 3.0.1:
ruby-1.9.2-p0 > require ‘rubygems’
=> true
ruby-1.9.2-p0 > require ‘active_support’
=> true
ruby-1.9.2-p0 > [1,2,3].rand
NoMethodError: private method rand' called for [1, 2, 3]:Array from (irb):3 from /Users/yumitsu/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in’
ruby-1.9.2-p0 > [1,2,3].random_element
NoMethodError: undefined method random_element' for [1, 2, 3]:Array from (irb):4 from /Users/yumitsu/.rvm/rubies/ruby-1.9.2-p0/bin/irb:17:in’
BUT:
Loading development environment (Rails 3.0.1)
ruby-1.9.2-p0 > [1,2,3].rand
=> 1