Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Jarbler: Run a Ruby application as Java jar file

Jarbler: Run a Ruby application as Java jar file

Jarbler is a solution that packages Ruby applications in a jar file so that they can be executed on the target environment without a Ruby runtime environment under Java.
https://github.com/rammpeter/jarbler
The main motivation for the function in principle is to be able to run Ruby applications without Ruby being installed on the target system. This is particularly important for frequently used apps where the various runtime environments in Linux, Windows or Mac OS are not known beforehand. Java is a lower hurdle than Ruby.

Avatar for Peter Ramm

Peter Ramm

May 26, 2025
Tweet

More Decks by Peter Ramm

Other Decks in Technology

Transcript

  1. Otto Group one.O 2 About Otto Group one.O Fusion to

    one.O 2025 Parent company Otto Group Locations Dresden, Hamburg, Altenkunstadt, Madrid, Málaga, Valencia, Taipei, Hyderabad Number of employees around 1,000 Management Board Katrin Behrens, Dr. Stefan Borsutzky
  2. Software architect / team lead at OSP in Dresden >

    30 years of history in IT projects Main focus: • Development of OLTP systems based on Oracle databases • From architecture consulting up to trouble shooting • Performance optimization of existing systems About me Mail: Peter.Ramm@og1o.de Contacts: • Teams • Peter.Ramm@og1o.de • BlueSky
  3. Jarbler • Pack an existing Ruby application into a self-

    starting Java jar file • Based on JRuby • Run Ruby apps without Ruby environment at target machines • Simple use, preconfigured for Rails apps • The project and documentation can be found here: https://github.com/rammpeter/jarbler
  4. Jarbler Simple demo without Gem dependencies • Single Ruby file

    “hugo.rb” to execute • Create empty Gemfile, run > bundle install • Generate config file: > jarble config • Adjust content in file config/jarble.rb • config.executable = 'hugo.rb' • config.includes = ["hugo.rb"] • config.jar_name = 'hugo.jar’ • Create jar file by > jarble • Run app by > java –jar hugo.jar
  5. Jarbler Rails demo with default Gem dependencies • Starting with

    Rails 8.0.2 with Ruby 3.4.4 • Run app by > java –jar hugo.jar fails with Source locally installed gems is ignoring #<Bundler::StubSpecification name=puma version=6.6.0 platform=ruby> because it is missing extensions • With Rails 6.1.7.10 and Jruby 9.4.12.1 it will work after minor changes • concurrent-ruby needs to be 1.3.4, Rails fails with 1.3.5 Gemfile needs to be adjusted • Webpacker removed • sassc has native extensions -> sass-rails removed in Gemfile • rails server did not react in production mode known issue, but forgot solution • Demo in development mode will work now
  6. Many thanks for your interest Peter Ramm Team Lead Architecture

    Consulting Contact me via Teams Peter.Ramm@og1o.de BlueSky