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?
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.
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.
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 .
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With