Grails vs Rails. Which has better support? And which one is a better choice to develop medium size apps with? Most importantly which one has more plug-ins?
13 Answers
One other thing worth mentioning: the design philosophy of both framework is somewhat different when it comes to the model. Grails is more "domain-oriented" while Rails is more "database-oriented".
In Rails, you essentially start by defining your tables (with field names and their specifics). Then ActiveRecord will map them to Ruby classes or models.
In Grails, it's the reverse: you start by defining your models (Groovy classes) and when you hit run, GORM (Grails ActiveRecord equivalent) will create the related database and tables (or update them). Which may also be why you don't have the concept of 'migrations' in Grails (although I think it will come in some future release).
I don't know if one is better than the other. I guess it depends on your context.
This being said, I'm still myself wondering which one to choose. As Tom was saying, if you're dependent on Java you can still go for JRuby - so Java reuse shouldn't be your sole criterion.

- 3,120
- 3
- 28
- 21
-
3There are at least 2 Grails plugins that perform DB migrations – Dónal Aug 26 '09 at 17:55
-
2I fail to see how this got so many votes..."domain-" vs "database-oriented"? I don't think it would make it into the top 100 most important differences... – Tomislav Nakic-Alfirevic Jan 19 '12 at 13:15
-
1This is a main difference if you think about grails and rails because the rest is so similar when you look on grails (best concept-copy of rails in the java-world so far) that i don't see any greater difference than domain vs database-orientation. – hasan Aug 03 '14 at 21:25
I guess if you are a Java developer and want to have access to all the existing enterprise Java libraries and functionality... go with Grails.

- 1,666
- 12
- 12
-
5You can run Rails in JRuby, so I don't think this is a strong argument. – chaostheory Dec 27 '10 at 03:39
Rails is more mature, has more plugins, has a bigger userbase, has better documentation and support available. It can also run on JRuby giving access to Java libraries if you require.
Grails has some interesting qualities, but can't claim to be up there with rails just yet. However, if you're predominantly a Java or groovy developer you may prefer it. Otherwise though, I'd suggest using Rails for medium sized projects right now.

- 5,788
- 3
- 26
- 22
-
17More mature? The language? Maybe. Plugins? Probably. ORM? Not by a long shot. 99% of Grails ORM code is Hibernate, which itself probably has more engineer-years behind it than all Rails code together. Ditto for the IoC engine (Spring) and, of course, the runtime (JVM). – Tomislav Nakic-Alfirevic Jan 19 '12 at 13:18
-
there is 4 years from the response of tomafro to the comment of @Tomislav. Maybe the balance changed nowadays? – chelder Jun 12 '13 at 15:50
-
2Here are a few numbers (engineer-years per project, estimated using the COCOMO model): RoR: 44, Spring 320, Hibernate 300, OpenJDK 1700. In short, RoR is only starting to show up on a linear scale...and by the way, Grails: 79. (source: ohloh.net) In short, the intensity of RoR development is currently insignificant compared to the Grails technology stack. – Tomislav Nakic-Alfirevic Jun 13 '13 at 07:36
-
9COBOL: 15M engineer-years. Go with COBOL instead, it's the future. – Jonas Byström Nov 21 '13 at 10:23
-
I used rails before and liked it quite a bit. However, my current company had a lot of legacy java code and therefore the natural choice was grails.
When I started with rails, very few sites were using it and documentation was atrocious. There was railscast that was great and railsforum.com, but anything out of the ordinary, you're on your own. Deploying it was a nightmare, and using mongrel-clusters was not really production ready. This is very different now as everybody can see, much more mature and deployed everywhere.
Over a year back, I had to learn grails due to reason I cited above. Transitioning to grails was very easy, since it is very similar to Rails. Again, it was very similar to the early stages of rails, with one huge difference. Because you can easily import java code, grails users can use almost all the production tested java libraries available out there. I've been able to successfully integrate our legacy java projects into grails projects and very little tweaking are needed. You will also notice that plugin development has been rapid, mainly because developers are just writing grails "hooks" but the underlying code are the old java libraries. Deploying grails is also just deploying a WAR file.
Another thing you have to look at is IDE. If you're comfortable with eclipse, then eclipse-STS for grails gives you all the bells and whistles. I still see a lot of rails developers use textmate, though rubymine has made great strides (the early version of rubymine used to grind my ubuntu to a halt).
The bottom line, both are great MVC frameworks. RoR is much more mature and has a lot more developers. Grails is where RoR was 3-4 years ago, but I see the progress a lot more faster. Hope this helps.

- 12,218
- 5
- 47
- 69
I say grails since there are so many java libraries out there. But I am a bit biased due to the fact that I come from a java background.
If the app isn't going to be big, either suffices - and the choice ought to depend on existing infrastructure. Say if you already have a java servlet container server running, you might as well stick with grails instead of provisioning another server for rails.

- 14,540
- 3
- 37
- 44
It depends on your skills with Ruby and/or Groovy, whether you have legacy Java systems to deal with, and where you want to deploy your applications.
I was initially thrilled with Rails. At the time, there wasn't an option of deploying on the application servers at work since work is all Java. This has changed. I couldn't abandon the Java infrastructure and applications already in place and switch to Ruby, even though I thought Rails was awesome. Grails works because we can mix and match Groovy with the existing Java solutions.
Outside of work, Ruby is easier to find hosting for at the low end of the price spectrum. Because Grails uses a lot of existing Java projects the .war files, even for a small app, tend to be large. If you have a dedicated server this isn't a problem but trying to run on shared hosting with 128 MB RAM doesn't work.
2008 is the year of Groovy and Grails books but there are still many more Rails resources available.
Based on your specific criteria, Rails may be a better framework to learn. If you have any Java knowledge, or baggage ;-), you should look at Grails.

- 1,695
- 2
- 15
- 19
Seeing as how the guys who make Grails just got bought out by Spring source yesterday, I would say Grails.
Also, since Groovy is a superset of Java, you can dive right in just using the Java you know without having to learn Ruby. Now, you'll learn a lot of dynamic stuff too and eventually write Groovy code instead of Java code, but it lowers the barrier to entry.
Grails all the way!

- 1,124
- 1
- 12
- 20
I would go with Grails since I like its approach (specify your domain classes and have Grails generate everything else) better than the Rails one (build database tables and have Rails generate everything else). If you're a Java developer, you'll also like that Java code is valid Groovy code, and a Groovy class is a Java class so the integration is seamless both ways.

- 1,036
- 11
- 18
As a Grails developer coming from Java, I loved it from the very first time.
Now, I'm starting to dig into Rails and having problems with gem. While MySQL connection setup with Grails was pretty straightforward, I'm still struggling to make it work with Rails.
The command gem install mysql
is not working, apparently because I don't have XCode intalled.
If it weren't for its memory consumption issue, I'd say Grails is perfect.

- 11,718
- 21
- 43
- 52
May I suggest Merb? It is rack-based, modular, ORM-agnostic, built for speed from ground up by Ezra Zygmuntowicz. It is starting to gain some heat now...

- 68,043
- 8
- 59
- 60
Rails is more mainstream, but less flexible. Grails is still changing rapidly, doesn't have the same developer ecosystem, and the documentation isn't nearly as mature, but it will work in some situations Rails won't.

- 70,339
- 36
- 160
- 222
-
1Grails has good documentation, for me the reference guide is excelent http://grails.org/doc/1.0.x/ – dahernan Sep 17 '08 at 11:09
-
The Grails documentation has been misleading and/or wrong on multiple occasions during my short experience with it. Also, there were no good, current books as of about 3 months ago. – Hank Gay Sep 17 '08 at 11:16
-
In my experience I only found a bug in documentation, I raised a Jira issue in the grails project, and It was fixed in 5 days. About books, Grails in Action is in progress http://blogs.bytecode.com.au/glen/2008/09/16/grails-in-action--1-3-of-the-way-there---.html. – dahernan Sep 17 '08 at 11:31
-
I don't dispute that the Grails team is actively improving the documentation, but it isn't nearly on par with Rails, yet. I've modified my comment to try to reflect that better. – Hank Gay Sep 17 '08 at 11:42
-
1Saying that Rails is somehow 'less flexible' shows a lack of understanding of the Ruby ecosystem. – rfunduk Feb 20 '09 at 19:58
-
2Let the record reflect that this answer is probably meaningless at this point - Grails and Rails have both been moving at lightspeed since I wrote this. – Hank Gay May 04 '10 at 16:34
I think it depends on the environment you're working in to some extent.
Grails seems to have more corporate level acceptance.
Rails has the Koolaid-vibe, and is very acceptable for start-ups with no legacy systems.
Personally I'm using both. Though only really just starting out in the Grails world - I like that authentication/authorisation is easier in Grails-one simple plugin; Shiro. I like that Rails isn't dependant on JVM, and doesn't take a minute or so to startup.
I find setting up BDD/Cucumber within Rails was far easier, but that could just be because that's what I'm comfortable with! There's definitely efforts in the Grails world (cuke4duke etc) to make this easier-and an active community developing Grails.
Just my 2p·
Try both :)

- 399
- 4
- 14
I have used turbogears and rails a little bit. Before using rails, I tried using grails because I was using groovy for my scripting. Grails was a difficult experience.
The groovy call stack is difficult to read for a small program, but when you add in several heavy weight frameworks a simple error can yield 100s of lines. Unlike rails the grails version that I was using didn't have tools to help me determine what was mine and what belonged to the framework.
I eventually switched to using the Google Web toolkit since I really didn't need the database.
I think Grails and Groovy hold promise, but the user experience of working with them is cumbersome at present (present being last spring).

- 12,364
- 20
- 77
- 135