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.

29 comments:

Priya Rathod said...

It is very hopeful, what I see and read here can provide insight for me and other friends.
AWS Training in Hyderabad
AWS Course in Hyderabad

Bhuvana said...

Wow, cool post. I'd like to write like this too - taking time and real hard work to make a great article...

Data Science Training in Hyderabad

Training Institute said...

You have completed certain reliable points there. I did some research on the subject and found that almost everyone will agree with your blog.

Artificial Intelligence Training in Bangalore

Professional Course said...

Really impressed! Everything is a very open and very clear clarification of the issues. It contains true facts. Your website is very valuable. Thanks for sharing.

Digital Marketing Training in Bangalore

Data Science Training in BLR said...

I wanted to leave a little comment to support you and wish you the best of luck. We wish you the best of luck in all of your blogging endeavors.

Data Science Training in Bangalore

Machine Learning Course in BLR said...

Happy to chat on your blog, I feel like I can't wait to read more reliable posts and think we all want to thank many blog posts to share with us.

Machine Learning Course in Bangalore

Edison hope said...

Attractive component of the material. I just stumbled across your web site and accession capital to say that I really enjoyed your site. The Turkish government uses a web-based visa issuance system to quickly apply for a Turkish visa using your laptop, tablet, smartphone or desktop PC. Traveling to Turkey from Canada, the visa application process takes no more than ten minutes.

dmProITacademy said...

I recently came across your article and have been reading along. I want to express my admiration of your writing skill and ability to make readers read from the beginning to the end.
Data Analytics Courses In Pune

Professional Course said...

I have read your article, it is very informative and useful to me, I admire the valuable information you offer in your articles. Thanks for posting it ...

Cloud Computing Institutes in Bangalore

Tom said...

Thank you The international travelers who travel to Kenya need visas Kenya. That they can apply online and can get the 24*7 customer assistant and pay online kenya visa costs.

Tamil novels said...

Thank you for sharing this wonderful article.
Tamil novel writers
Ramanichandran novels PDF
srikala novels PDF
Mallika manivannan novels PDF
muthulakshmi raghavan novels PDF
Infaa Alocious Novels PDF
N Seethalakshmi Novels PDF
Sashi Murali Tamil Novels PDF Download


Alexander Jacob said...

I get your meaning, saved in my bookmarks, a very decent website.. India visa for us citizens, US citizens are eligible to apply for the India eVisa. The process is completely online and there is no need to submit the paperwork in person to any Indian Embassy or Consulate.

Professional Course said...

I read your excellent post. It's a great job. I enjoyed reading your post for the first time. I want to thank you for this publication. Thank you...

Data Analytics Course in Patna

Ava said...


Great article this is really informative and innovative: with new updates.with new updates. It was really valuable. Thanks a lot. Travelers can easily apply for Indian visa online. The Government of India has provided an easy-to-use method to apply for an Indian Visa.

Professional Course said...

Wonderful illustrated information. Thank you. It will certainly be very useful for my future projects. I would love to see more articles on the same topic!

Data Science Training in Bangalore

Professional Course said...

Good blog and absolutely exceptional. You can do a lot better, but I still say it's perfect. Keep doing your best.

Data Science Training in Durgapur

Data Science Course in Bhilai - 360DigiTMG said...

Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

Data Science Training in Bhilai

Yavasol said...

gate
binance
coinbase mi binance mi
bitcoin
binance referans kimliği nedir
kripto para nasıl alınır
coin nasıl alınır
binance 20
tiktok jeton hilesi

Data Science Training in Bangalore said...

I read your excellent post. It's a great job. I enjoyed reading your post for the first time. I want to thank you for this publication. Thank you...

Data Science Course in Patna

jacobalexander said...

I thought I was familiar with this blog, but after checking through some of the posts, I realized it's actually a brand new one to me. Anyway, I am definitely glad I found it and I will bookmark it and come back often. 10 year Indian visa for US citizens, You can apply 10 year India visa online

jacobalexander said...

After looking through some of the posts I realized it was a new blog for me. Anyhow, I am delighted I found it and will return soon. 10 year Indian visa for US citizens, You can apply for a 10 year Indian visa online.

Professional Course said...

I really appreciate this wonderful message you have given us. I assure you that would be beneficial for most people.

Data Analytics Course in Nagpur

Joseph Vijay said...

Much obliged for sharing this brilliant substance. its extremely fascinating. Numerous web journals I see these days don't actually give whatever pulls in others however the manner in which you have plainly clarified everything it's truly awesome. There are loads of posts But your method of Writing is so Good and Knowledgeable. continue to post such helpful data and view my site too...
how to make a paper airplane eagle | how to make a boomerang airplane | the eagle paper airplane | best paper airplane design for distance and accuracy | best paper airplanes for distance and speed | what is the best paper airplane design for distance | paper airplane that flies far and straight | nakamura lock paper airplane instructions | paper airplane templates for distance | science behind paper airplanes

Albert said...

Good morning everybody.. Your article is more useful for all the people. Thank you sir.. Many people query What is Indian visa service fee? Visa fee depends on your nationality and your visa duration. You can read all other information about the Indian e-visa on our India eVisa page. We have explained all requirement on our page....

Maria Baby Thomas said...

Hello sir, thanks for the amazing post. Planning a holiday in India. Is indian e visa open ,yes India visa open you can now apply for India visa online.


Jacy Knightly said...

Loved the inspirational article thanks. Citizens of the United States of America need a visa to travel to India. Yes, India visa for US citizens, US citizens can apply online for an Indian visa. Indian visa for US citizens is issued for under the following 5 categories:- You can choose your category then apply for your visa.

Jack Dnial said...

Thanks for sharing this blog, this blog is very useful information for everyone.We provide Complete solutions for BPO Services, If you have any query related to Support services then visit our website and will get complete information related to your query.

Olivia John said...

I read your blog and found many interesting metrics in this material. Thanks for sharing it on the Internet. Person who is willing to visit Turkey can apply for a Turkey visa which is a totally online process. Fill the application form, make payment & receive it in email. As simple as that.

Seian Tosty said...

Wow you have nice content on your page. Your audience will enjoy it while they are read. Turkey visitors can apply e visa of Turkey online from anywhere in the world. The process is easy and convenient which saves your time & money.