JRuby is a Java implementation of the Ruby programming language. It allows embedding of the interpreter into any Java application with full, two-way access between the Java and the Ruby code. So, if you are a Ruby developer and you would like to deploy your application to the cloud, Jelastic is the best way. It's easy and fast.
To see how easy it is just follow the next steps:
A. Create the Application
- First of all you have to install JVM for your OS.
- Navigate to jruby.org and download the latest JRuby release (Jelastic supports JVM-based languages). Don't worry: it is Ruby for the JVM and and there won't be any problems.
- Extract the files from the zip package you have just downloaded.
- Install Rails, an open-source web framework that lets you write "beautiful code by favoring convention over configuration". It's pretty easy, just type the following strings at command line:
- Install warbler, which allows to make jar and war files out of application.
- Create a new project in rails_projects, for example app:
- Create your .WAR file with just one command warble:
c:\ jruby-126.96.36.199>cd bin
c:\ jruby-188.8.131.52\ bin>gem install rails
Gem is the command-line interface for RubyGems, the standard Ruby package manager. Using RubyGems you can install Rails and its dependencies through the command line.
c:\jruby-184.108.40.206\bin>gem install warbler
c:\rails_projects>rails new app
B. Create the Environment
- Log into the Jelastic Manager
- Use Jelastic to create a new environment.
- In the Environment topology window select your application server (e.g. Tomcat 6) and type your environment name, for example, RubyonRails, then click on Create button.
In a minute your environment with Tomcat 6 will be successfully created.
C. Upload the Java Package
- Upload your WAR file to the Deployment manager.
- Once the package is in Jelastic, deploy it to the environment you have just created.
Finally, you can open you app in a browser and enjoy!