Using Ruby libraries and gems with a Shoes app

送分小仙女□ 提交于 2019-11-30 00:32:16

Hey, _why posted on his blog, hackety.org, about using gems within Shoes. I hope it helps!

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

For shoes4, the Shoes.setup method is deprecated. You can install the gems you need by either:

  1. gem install net-ssh
  2. Using bundler and a Gemfile

Then, you only need to require 'net-ssh' in your application.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!