Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the best way to package a Ruby on Rails Application?

So I have created a ruby on rails application that functions as a basic calculator. Now I want to package this application up, upload to github, download onto Jenkins, and create a Jenkins job that will run this ruby application.

Normally if this was a Java Application, you would package it as a jar file and then run the jar file. What would I package this Ruby application as?

I thought about packaging this application as a Ruby Gem, but aren't Ruby Gems mainly for when you want to use your ruby app inside of another ruby application? I want to run this app as a stand alone application.

Even if I were to package the Ruby on Rails app as a Ruby Gem, how would I run the gem as a stand alone gem? What would be the command to run it as such from the command line?

like image 947
user1842633 Avatar asked Jun 29 '16 01:06

user1842633


People also ask

Is Ruby on Rails still relevant 2022?

Ruby's and Ruby on Rails' Overall Popularity Although way behind main contenders, such as PHP or Python, Ruby still makes the cut for the 20 most popular programming languages list in 2022. The 2022 edition of Stack Overflow Annual Developer Survey also places RoR in a similar spot.

How do we do package management in Ruby using Ruby Gems?

A Ruby Gem package allows developers to bundle up the code into a single package that can be installed through one process. Gem is great for shell scripting, system administration, and application scripting. You can easily open a local or remote file on the command line.

How do I run a Ruby on Rails application?

Go to your browser and open http://localhost:3000, you will see a basic Rails app running. You can also use the alias "s" to start the server: bin/rails s . The server can be run on a different port using the -p option. The default development environment can be changed using -e .


1 Answers

Unlike Java applications that have packaging as a first class citizen(be it a jar or a war) this concept isn't baked in most development environments.

That's why there a big push towards docker, it allows you to insulate your app(and gem dependencies) and plug it into the production environment much like dropping a war into a container.

Here's an article about dockerizing a Rails app: https://semaphoreci.com/community/tutorials/dockerizing-a-ruby-on-rails-application

like image 155
Raphael Avatar answered Sep 26 '22 16:09

Raphael