Clearing Up The Whole Shoes And RubyGems Deal

May 8th 00:18
by why

So, I have a matter of Shoes business. Everybody always asks about how to get SQLite working with Shoes. Or, uh, what’s the other one: ImageMagick? No, that can’t be it. Well, krikey, I can’t remember.

At any rate, here’s my reason for stalling.

This is Shoes. Which isn’t a Ruby library. It’s not a gem. It’s a kit. Shoes has an installer. You click on a .shy file (such as Tetris) and it launches Shoes.

And Shoes does the pulling down of gems and libraries. Take this small and very contrived Shoes script:

Shoes.setup do
  gem 'json >= 1.1.1'
  gem 'activerecord'
end

require 'json'
require 'activerecord'

Shoes.app do
  @msg = para "ALL SYSTEMS GO"
  animate(20) { @msg.toggle }
end

By putting your gem list in the Shoes.setup block, you’ll end up encountering the Shoes popup seen above if any of the gems happens to be absent. Gems are installed in ~/.shoes, to avoid needing superuser rights. (And just to keep Shoes away from messing with your normal Ruby stuff.) Leopard has some compiling problems, but other platforms are doing good. That setup window needs a cancel button.


And that’s all. I hope you have learned something. I know I did. Because I realized the thing about the cancel button.

Yes, well, and for Ruby scripts that aren’t in a gem: no sweat. Just drop those in the same directory as your Shoes script and require them. That was probably obvious, but it still feels good to get that off my chest.

Oh, also: the SQLite lib comes with Shoes since about a week ago. See, sometimes I need these gems, too.

Now begin the comments …

12 comments

nil

said on May 8th 03:29

Can we still set something up to bootstrap Shoes from little Red Ballons?

dan

said on May 8th 07:49

Out-frigging-standing! Well played, master!

Juixe TechKnow

said on May 8th 08:48

Lacing up the latest release of Shoes.

evanfarrar

said on May 8th 13:47

I noticed the sample/simple-rubygems.rb last night. This was the last thing I was waiting for in order to release a couple of little apps on the world. I just couldn’t bear to provide installation instructions with my shy files. Thanks Why!

whynot?

said on May 9th 15:15

Why is shoes not available as a gem itself?

zerohalo

said on May 9th 21:48

I’m still wondering the same myself

OMouse

said on May 9th 23:59

@whynot?
@zerohalo

Shoes is self-contained. It makes sure your socks/ruby-gems are on. The point of this is that it’s easier for a user to get started using a Shoes app. No worries about dependencies, Shoes will put your socks on for you.

(At least I think that’s how it works.)

whynot?

said on May 12th 08:51

@OMouse: I still don’t understand why shoes can’t be packaged up as a gem for those of us who prefer managing code installs that way.

_why

said on May 12th 17:22

Shoes isn’t a gem. It’s a Ruby distro. It’s like asking why Squeak isn’t a ruby gem!

whynot?

said on May 15th 10:34

It’s like asking why Squeak isn’t a ruby gem!

Well, why isn’t it ;)?

Ah, ok….I thought Shoes was merely a GUI library for Ruby?

kcbanner

said on May 21st 12:38

I thought it was just a lib as well

Ian

said on May 24th 22:17

Shoes is a way of life. You cant package this in a gem. That is blasphomius

Comments are closed for this entry.