如何在warbler jar中包含gem(计时器)?
bin
myapp
(档案)lib
/myapp/bin/myapp
内容: require 'timers'
timers = Timers::Group.new
five_second_timer = timers.after(5) { puts "Take five" }
$ warble jar
rm -f myapp.jar
Creating myapp.jar
$
java -jar myapp.jar
输出: LoadError: no such file to load -- timers
(...)
答案 0 :(得分:1)
尝试使用bundler
gem install bundler
在项目的根目录下创建文件Gemfile
并在其上编写依赖项:
gem 'timers'
现在,warbler将正确添加依赖项。