Rails and Merb are MVC web application frameworks written in and for Ruby. Both the framework is similar in terms of their directory structures and concepts.
Now, We have to compare Rails and Merb. and findout which one is best?
Rails is not Modular based. As Merb is Modular.
Rails is focused on rapid development for the web programmer. Merb is focused on speed and extensibility.
In terms of speed comparison merb is faster than rails. because Merb intentionally is lighter than Rails. Faster means that processing time is spent less inside framework code and more inside the custom code. Merb also uses a faster Ruby re-implementation Erubis over the original and slower ERB.
In terms of stability Rails latest version 2.2.2 is very stable and Merb version 1.0. Most of production server uses Rails compare to merb.
Rails opinionated in Javascript library, ORM, and template language. Where Merb Javascript library, ORM and template language agnostic.
Merb is use Datamapper where Rails more prefer ActiveRecord for database interaction.
There are syntax and file structure difference in Rails and Merb.
a. Create new application ‘test_app’
Rails: rails test_app
Merb: merb-gen app test_appb. Start server
Rails: script/server
Merb: merbc. Interactive console
Rails: script/console
Merb: merb -id. Generate scaffold
Rails: script/generate
Merb: merb-gene. Server configuration
Rails: config/environment.rb
Merb: config/merb.ymlf. Initialization code
Rails: config/environment.rb and config/initializers/*
Merb: config/init.rbg. Dependencies
Rails: config/environment.rb
Merb: config/dependencies.rbh. Response format
Rails: respond_to
Merb: provides :xml, :js, :yamli. Notice format
Rails: flash[:notice]
Merb: message[:notice]j. Observer
Rails: before_filter
Merb: beforek. Set Routes
Rails: config/routes.rb
Merb: config/router.rbl. Migrations
Rails: db/migrate
Merb: schema/migrationsM. Testing
Rails: test Merb: spec & testSo, Based on application requirement you are able to choose which framework is more preferable. Now It’s your time to make decide..
Great News, that Now Merb gets merged into Rails 3!
Sorry, comments are closed for this article.