Create an executable jar using sinatra, warbler and jruby-openssl

I am trying to create a simple war executable using sinatra and warble. I have a simple lib / app.rb file with:

require 'rubygems' require 'sinatra' class Hiwar < Sinatra::Application get '/' do body "Hi!" end end 

config.ru file with:

 require 'rubygems' require 'lib/app' run Hiwar.new 

and the config / warble.rb file with:

 Warbler::Config.new do |config| config.dirs = %w(config lib) config.gems += ["sinatra","rack","rack-protection","tilt","jruby-openssl"] end 

When I execute:

 $ warble executable war 

I get:

 warble aborted! Zip end of central directory signature not found Tasks: TOP => war:files (See full trace by running task with --trace) 

I saw that if I remove the pearl "jruby-openssl" from the list, it does not complain and does not create a war file, but when I execute it, it causes an error 500:

 undefined method `ssl?' for class `Sinatra::Request' 

Is there an easier way to create an executable banner using sinatra?

+4
source share
1 answer

Take a look at Rawr , which allows you to use jruby-complete to embed a Ruby interpreter within a jar.

I spent the last 3 days getting a working demo called FontX that converts .ttf to various other font formats. Run 'rake rawr: jar' to compile, then rake start to view.

Fontx on github

0
source

Source: https://habr.com/ru/post/1384269/


All Articles