Skip to content

Instantly share code, notes, and snippets.

View hiremaga's full-sized avatar

Abhi Hiremagalur hiremaga

View GitHub Profile
$ rails c
Loading development environment (Rails 3.0.0.rc)
ree-1.8.7-2010.02 > JSON.pretty_generate(:foo => :bar)
ArgumentError: wrong number of arguments (2 for 1)
from /.../ree-1.8.7-2010.02@rails3json/gems/json-1.4.3/lib/json/common.rb:270:in `to_json'
from /.../ree-1.8.7-2010.02@rails3json/gems/json-1.4.3/lib/json/common.rb:270:in `generate'
from /.../ree-1.8.7-2010.02@rails3json/gems/json-1.4.3/lib/json/common.rb:270:in `pretty_generate'
from (irb):2
ree-1.8.7-2010.02 >
$ ruby -rubygems -e 'require "active_support"; class Foo; class Bar; end; class Baz; end; end; Foo::Bar::Baz'
/.../gems/activesupport-2.3.8/lib/active_support/dependencies.rb:417:in `load_missing_constant': Foo is not missing constant Baz! (ArgumentError)
from /.../gems/activesupport-2.3.8/lib/active_support/dependencies.rb:96:in `const_missing'
from /.../gems/activesupport-2.3.8/lib/active_support/dependencies.rb:98:in `send'
from /.../gems/activesupport-2.3.8/lib/active_support/dependencies.rb:98:in `const_missing'
from -e:1
@hiremaga
hiremaga / Output
Created March 2, 2010 22:07
Signal Handling: Ruby vs JRuby
orange:~ $ ruby signal_handling.rb
pid 81402 is sleeping...
^CRuby ensure was run!
Ruby at_exit was run!
signal_handling.rb:34:in `sleep': Interrupt
from signal_handling.rb:34
orange:~ $ jruby signal_handling.rb
pid 81431 is sleeping...
^CJava shutdown hook was run!