1

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

(...)

Community
  • 1
  • 1
  • possible duplicate of [JAR generated by warbler cannot access included internal JAR library](http://stackoverflow.com/questions/11122130/jar-generated-by-warbler-cannot-access-included-internal-jar-library) – Sully Jan 29 '15 at 12:25

1 Answers1

1

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.

GcL
  • 501
  • 6
  • 16