gregs

helping me remember what I figure out

December 28, 2010
by gregs
0 comments

Gem install issues

PLAIN TEXT CODE: Installing nokogiri (1.4.3.1) with native extensions /Users/username/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/1.9.1/rubygems/installer.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) Installing the nokogiri gem was throwing the above exception, but the clue to the problem lay at … Continue reading

August 29, 2010
by gregs
0 comments

Some ruby conventions

Variable names Local variables, method paramaters and method names: start with a lower case letter and don't follow the camel case convention instead, eg. my_var, my_method_name(withMyParameter). Also method names can end in ?,! and = Global variables start with a … Continue reading

August 28, 2010
by gregs
0 comments

performance monitoring/profiling

At a higher level you can call: PLAIN TEXT CODE: ruby script/performance/benchmarker 'User.encrypted_password("secret", "salt")' Which returns a high level execution plan. PLAIN TEXT CODE: user     system      total        real #1      0.000000   0.000000   0.000000 … Continue reading

August 17, 2010
by gregs
0 comments

Clearing ruby/rails sessions

Using ruby 1.2.6 and rails 2.x, if sessions are stored in the database and you want to clear/reload session objects, open up a terminal window, navigate to your rails application folder and simply type: PLAIN TEXT CODE: rake db:sessions:clear