Posts about ruby
'Error compiling pg Ruby gem on OSX'

If you get this error (or similar) while trying to run **bundle install** on one of your Ruby projects or trying to install the **pg** gem:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

...

Ruby bundle dependency tree

On OSX:

brew install graphviz && gem install ruby-graphviz && bundle vi

On Linux:

apt-get install graphviz && gem install ruby-graphviz && bundle viz

On Windows:

Good luck! ;)

This will generate a png image...

Date and time in ruby

Time.now will give you the current date (and time), like so:

Time.now 2012-11-22 22:35:01 +0000

You can also request all the date parts individually:

Time.now.hour 22 Time.now.min 35 Time.now.sec 01 Time.now.day 22 Time.now.month 11...

A collection of useful Ruby/Rails gems

Since lately i've been working a lot with Ruby (Android and Java as well, but that's a different story), i figured i posted a couple of interesting gems that will make your life easier, especially but not only for rails.

Slim

Slim is a templating...