My First Firefox Theme – Part II .NET Pipelines and Filters!
Feb 07

image

Everyone knows that developing rails applications on Windows is quite a burden, right?

It’s so slow and …i cannot find the right word, but it really sucks.

If you are tired of that, there’s a solution to speed up your rails development on windows, that’s called JRuby on Rails!

But first, what is JRuby?

Wikipedia says:

JRuby is a Java implementation of the Ruby programming language, being developed by the JRuby team. It is free software released under a three-way CPL/GPL/LGPL license. JRuby is tightly integrated with Java to allow the embedding of the interpreter into any Java application with full two-way access between the Java and the Ruby code (similar to Jython for the Python language).

 

Basically is your ruby running in the JVM which is faster than ruby on windows.

So, we got the idea, let’s install that now, first download the next packages:

links:

- Java Development Kit aka JDK (if you don’t have java on your pc)

- JRuby Windows Installer

 

First double click on Java Development Kit and install, just next next next, forever next.

Then install the JRuby Windows Installer, double click and next next, you should see something like that:

image

Check out the box so we haven’t to add the Jruby to our windows path. Click next and wait for the end of the installation.

So now we can check if JRuby was installed correctly, open your cmd console and type:

image

ok, as we can see, we have the Jruby 1.4.0 installed, next step is to install the rails gem .

in your console type:

1 - jruby -S gem install mongrel activerecord-jdbcmysql-adapter rails

 

That will install the mongrel server, the jdbcmysql driver so we can connect with a  mysql database and the rails gems.

image

Ok, now if you type :

2 – rails –v

 

image

OHAY! Our JRuby on Rails is running fine : )

Let’s try to create an application:

First create the app:

jruby -S rails myapp -d mysql

 

Go to your database.yml and change the adapter, remember now we are running JRuby so we need the jdbcmysql adapter:

   1: development:
   2:   adapter: jdbcmysql
   3:   encoding: utf8
   4:   database: myapp_development
   5:   username: root
   6:   password:

 

Run your server:

 jruby script/server

 

Go to your browser and type http://localhost:3000/

image

OHAY! we are done and our application is running like a charm :P

PS1: I do not use Internet Explorer 6, since i was in a virtual machine running windows xp and i am too lazy to install firefox 6 i’ve decided to use I.E for this tutorial :P

PS2: Let your comments and spread the word, publish my post in your social media networks if you like.

PS3: Feel free to find me in your social networks using the right bar!

 

Thanks everyone and cya!

  • Share/Bookmark

One Response to “JRuby on Rails using Windows!”

  1. Social comments and analytics for this post…

    This post was mentioned on Twitter by igorhrk: RT @stJhimyBlog: JRuby on Rails using Windows! – http://bit.ly/aVoCF2 #JRuby #Ruby #programming #RubyOnRails #java give your RT developers : )…

Leave a Reply

preload preload preload