Brian
Brian

Reputation: 41

How to get Shoes to use an already installed gem?

I have a ruby gem I created and installed and want to be able to use it in a Shoes app. As expected, Shoes reports it cannot find the gem, understandably since the gem is only installed for the standard ruby distribution. Can help pointing towards documentation explaining how to get Shoes to find this gem would be most appreciated.

Thanks.

Upvotes: 4

Views: 1313

Answers (2)

c2h2
c2h2

Reputation: 12369

U can think Shoes as a ruby-distro, like jruby or other rubies, it maintains its own gems.

therefore you will need to install it via shoes way like Michael Kohl said

Upvotes: 0

Michael Kohl
Michael Kohl

Reputation: 66867

Unless things have changed since _why left, this is not possible. Shoes is a separate Ruby installation and therefore needs its own gems.

To install a gem, you can do something like this at the beginning of your Shoes app:

Shoes.setup do
  gem 'json'
end

Edit: there's also this previous SO thread:

Using Ruby libraries and gems with a Shoes app

Upvotes: 2

Related Questions