Tags All Entries

Ruby

Rails is the well known and popular web framework built upon ruby.

Fixing implicit declaration error during ruby gem build1

gem install mailcatcher -- --build-flags --with-cflags="-Wno-error=implicit-function-declaration"

Getting the memory size of an object

puts RUBY_VERSION #=>1.9.3

require 'objspace'

p ObjectSpace.memsize_of("a"*23)    #=> 23
p ObjectSpace.memsize_of("a"*24)    #=> 24
p ObjectSpace.memsize_of("a".*1000) #=> 1000
h = {"a"=>1, "b"=>2}
p ObjectSpace.memsize_of(h)         #=> 116
  • Note that this doesn’t do anything for finding the references of an object

Delegation


References

Links to this note