简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM