Require a Gemfile from a Gemfile

It is probably best I don’t bother explaining how or why I ended up wanting to reference an existing Gemfile from another Gemfile, but suffice to say it is something I sort of needed to do. After a bit of searching I came across the following post, http://madebynathan.com/2010/10/19/how-to-use-bundler-with-plugins-extensions/.

The most relevant bit is the use of eval like below in the Gemfile you want to include another Gemfile in.

filename="..."
eval(IO.read(filename), binding)
Advertisements
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

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