Tag: rubygem

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'
end

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.

Teach Me How to Make A Ruby Gem (by @steveklabnik)

Just a quick solution so I don’t (and everybody else as well) doesn’t lose those valuable links just given to me by Steve Klabnik. So how do you make ruby gem? There are so many of them and now I know why, it’s insanely easy to create them and then make them available to everyone!

Just go and watch Steve’s video (slides) or read his blogpost. He also introduces some best practices for creating gems. It doesn’t take a lot of time, but you will gain a great amount of knowledge, I assure you that!

So long, I’m off writing code for mendicant university 🙂