1
votes

How to include gem(timers) in warbler jar?

App structure:

  • myapp
    • bin
      • myapp (file)
    • lib

/myapp/bin/myapp content:

 require 'timers' 
 timers = Timers::Group.new
 five_second_timer = timers.after(5) { puts "Take five" }

Warbler build output:

 $ warble jar
 rm -f myapp.jar
 Creating myapp.jar
 $ 

java -jar myapp.jar output:

 LoadError: no such file to load -- timers

(...)

1

1 Answers

1
votes

Try using bundler

gem install bundler

Create the file Gemfile at the root of your project and write the dependencies on it:

gem 'timers'

Now warbler will add the dependencies correctly.