Shoes and ruby gems

As I just stumbled upon this and I need this: So how do you use ruby gems with shoes? Shoes is kind of a ruby interpreter on it’s own, so you got no access to your normal ruby gems there. It’s actually pretty easy as described in an old saved blogpost by why.

What you need to do is something like this:

Shoes.setup do
 gem 'twitter'
 gem 'oauth'
 gem 'launchy'

require 'launchy'

In the Shoes.setup block you set up all the gems you need. Then you can require them in this file, or in any other file which is required by this file. As you can see, I only require launchy here, the rest is required in other files of my project.

What happens when you next launch the application is the following: Shoes goes on to install the gems:

So and there you got it, ready to play with shoes and some ruby gems!

edit: Of course this only applies to red shoes, as green shoes is a gem itself you may use other gems with it exactly like you are used to.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s