Using Ruby libraries and gems with a Shoes app

后端 未结 2 812
再見小時候
再見小時候 2020-12-24 15:11

I am writing a little Shoes app that requires a library I wrote with my regular Ruby installation. My library uses the \'net-ssh\' gem and a bunch of other Ruby libraries.

相关标签:
2条回答
  • 2020-12-24 15:49

    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.

    0 讨论(0)
  • 2020-12-24 15:50

    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
    
    0 讨论(0)
提交回复
热议问题