how to properly include the libraries you need in ruby

this is again something pretty basic, but i was lost until i found this great explanation:

http://blog.8thlight.com/micah-martin/2007/10/08/micah’s-general-guidelines-on-ruby-require.html

and i ended up putting this line in my code

$: << File.expand_path(File.dirname(__FILE__) + "/lib/")

probably i should use /../lib and put my script in /scripts, should be cleaner

My first hints came from this other post, where i discovered require_relative:

http://blog.8thlight.com/micah-martin/2007/10/08/micah’s-general-guidelines-on-ruby-require.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s