Tuesday, January 17, 2012

Compiling Rails project for distribution in a WAR file with JRuby

I recently started using JRuby for a Rails project and overall the experience has been excellent.  Using RVM, you can just switch to jruby to build a new project (rvm use jruby), and just about everything will work the same.  One of the big features of JRuby is that you can bundle your entire app, including JRuby itself, in to a WAR file that Java servers like Tomcat and Glassfish can serve up, so your app can be distributed on to servers that only have Java.

After you have JRuby installed, simply install the gem warbler.  You'll then get a command line tool, warble, to generate war files from your project.  Simply run warble from your project's directory, and a war file will be produced.  It's as easy as that!

Another great feature is that the Ruby code can be compiled down to Java class files, so your source code is not visible.  This is great for distributing on to a server where other companies will have access that you don't want seeing your source code.  However, this is not working for me.  Warbler should support this, just run "warble compiled war" from the command line in your projects directory instead of "warble".  This will produce a war file with both .rb and .class files.  The .rb files however are simply stubs that require the .class file, none of your code is in there.  But, for me, it's not generating .class files on all of my controllers.  I've entered an issue for this at https://github.com/jruby/warbler/issues/72.


I will be making another post on how to do database migrations on the server you're deploying to.

20 comments:

Chitra devi said...

Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.

rpa training in bangalore
best rpa training in bangalore
RPA training in bangalore
rpa courses in bangalore

param jothi said...

I likable the posts and offbeat format you've got here! I’d wish many thanks for sharing your expertise and also the time it took to post!!
Python Online certification training
python Training institute in Chennai
Python training institute in Bangalore

manisha said...

That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.
AWS Training in Bangalore

Maria said...


The class today has become the happiest person I managed to find a part-time job at home and I really get interesting? fine play casino games for real money you can not thank

Madhu Balan said...

Whatever we gathered information from the blogs, we should implement that in practically then only we can understand that exact thing clearly, but it’s no need to do it, because you have explained the concepts very well. It was crystal clear, keep sharing..
Java Training in Chennai
Java Training in Coimbatore
Java Training in Bangalore

SARATH KUMAR said...

great article....thanks for sharing waiting for next update..
Manual Testing Training in Chennai
Manual Testing courses in Chennai
testing courses in chennai
Manual Testing Training in Anna Nagar
Manual Testing Training in T Nagar
Mobile Testing Training in Chennai
core java training in chennai
DOT NET Training in Chennai
Hibernate Training in Chennai
Html5 Training in Chennai

Riya Raj said...

Good blog!!! It is more impressive... thanks for sharing with us...
Selenium Training in Chennai
Best selenium Training Institute in Chennai
selenium testing course in chennai
Selenium Course in Chennai
Selenium training in Thiruvanmiyur
Selenium Training in Velachery
Python Training in Chennai
Software testing training in chennai
Python Training in Chennai
JAVA Training in Chennai

lokeshivam said...

Great info. The content you wrote is very interesting to read. This will be loved by all age groups.
Blue Prism Training in Chennai
Blue Prism Training Institute in Chennai
Blue Prism course in Chennai
R Training in Chennai
Data Science Training in Chennai
RPA Training in Chennai
Blue Prism Training in Vadapalani
Blue Prism training in Thiruvanmiyur
Blue Prism training in Guindy

diya shivanya said...

Thank you for your efforts and I am inspiried with your written style.
IELTS Coaching in Chennai
Best IELTS Coaching in Chennai
german classes
learn Japanese in Chennai
Best Spoken English Class in Chennai
TOEFL Coaching Centres in Chennai
IELTS Coaching in OMR
IELTS Coaching in Porur

Sadhana Rathore said...

I gathered lots of information from your blog and it helped me a lot. Keep posting more.
ccna course in Chennai
ccna Training in Chennai
ccna Training institute in Chennai
AngularJS Training in Chennai
Ethical Hacking course in Chennai
PHP Training in Chennai
CCNA course in Thiruvanmiyur
CCNA course in Porur
CCNA course in Adyar

tech updates said...

Good Article
devops training in bangalore
hadoop training in bangalore
iot training in bangalore
machine learning training in bangalore
uipath training in bangalore

Sivanandhana Girish said...

A big thanks for this sharing this awesome post with us.Read it recently and felt very happy on reading every bit of the blog.
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
IELTS Coaching in Chennai
IELTS Coaching Centre in Chennai
English Speaking Classes in Mumbai
English Speaking Course in Mumbai
IELTS Classes in Mumbai
IELTS Coaching in Mumbai
IELTS Coaching in Anna Nagar
Spoken English Class in Anna Nagar

Bala said...

Very valuable post...! This information shared is helpful to improve my knowledge skill. Thank you...!
Oracle Training in Chennai
Oracle course in Chennai
Tableau Training in Chennai
Spark Training in Chennai
Advanced Excel Training in Chennai
Primavera Training in Chennai
Appium Training in Chennai
Power BI Training in Chennai
Pega Training in Chennai
Oracle Training in T Nagar
Oracle Training in Porur

tech updates said...

Visit Here => Big Data and Hadoop training in bangalore

Anbarasan14 said...

This was a great blog. Really worth reading it. Thanks for spending time to share this content with us.
Education Franchise India
Spoken English Franchise
Franchise For Spoken English Classes
Top Education Franchise In India
Best Education Franchise In India
Computer Education Franchise
Education Franchise India
Computer Center Franchise
Education Franchise Opportunities In India

subhashini said...

Nice blog! Thanks for sharing this valuable information
Ethical Hacking Course in Chennai
Hacking Course in Chennai
Ethical hacking course in bangalore
Ethical hacking course in coimbatore
Ethical Hacking Training in Chennai
Certified Ethical Hacking Course in Chennai
Ethical Hacking Training Institute in Chennai
Selenium Training in Bangalore

sasi said...

I really enjoyed this article. I need more information to learn so kindly update it.
Salesforce Training in Chennai
salesforce training in bangalore
Salesforce Course in Chennai
salesforce training institute in chennai
salesforce developer training in chennai
Salesforce Training Chennai
Big Data Course in Coimbatore
DOT NET Training in Bangalore

Pixies said...

Excellent blog thanks for sharing Pixies Beauty Shop is unlike any of the other cosmetic shops in Chennai. With tons of exclusive imported brands to choose from and the best value, this is the best shopping destination for your personal and salon needs.
Cosmetics Shop in Chennai

Adhuntt said...

Great blog thanks for sharing Online marketing has changed how businesses run and succeed in today’s highly competitive world. With Adhuntt Media, your E-commerce store can reach for the stars and find the right customers.
digital marketing company in chennai
seo service in chennai
web designing company in chennai
social media marketing company in chennai

Karuna said...

Nice blog thanks for sharing Karuna Nursery Gardens provides you with the best nursery solutions for setting you up with a glamorous landscape. That’s right, you have finally found the perfect nursery to set you up with the best house garden in Chennai.
plant nursery in chennai
rental plants in chennai
corporate gardening service in chennai