The purpose of life is not to win. The purpose of life is to grow and to share. When you come to look back on all that you have done in life, you will get more satisfaction from the pleasure you have brought into other people's lives than you will from the times that you outdid and defeated them.
Showing posts with label Ruby. Show all posts
Showing posts with label Ruby. Show all posts

How to freeze Rails to a older version?

Navigate to project directory and issue the below command.

rake rails:freeze:gems VERSION=x.x.x

Installing MySQL with Ruby Gem

Most of the official guides would recommend to install MqSQL database as
$gem install mysql

This won't work for sure in Windows platform. First setup your proxy. To know more please visit Rails Sucks. And finally after proxy setting setup issue the below command.

$gem install mysql -- --with-mysql-lib=/usr/local/mysql/lib

Top 5 reasons to choose Rails

I've worked on Rails to a certain extent and my top 5 reasons why I would choose rails to design my next app are,
1. Convention over configuration. This enables to set up the application, database configurations, and MVC stuff literally in minutes.
2. Active Record - Built in ORM. Domain object model can be configured easily and can be translated to Database. In J2EE or .Net this would require a lot of XML configurations and corresponding database mappings.
3. Support for REST (Representational state transfer). Rails have an implicit support for REST unlike J2EE and .Net.
4. Test Unit - Embraces test driven development.
5. Every dependency is a gem - Project related dependencies/libraries can be easily downloaded as gem install XXX.
However, the main criticism for Rails being scalability and non-availability of standard tool-set for development. My bet on Rails would be for trivial applications web apps.

Install SQLite3 for Ruby in Windows

1.  I downloaded sqlite3 dll zip from
http://www.sqlite.org/sqlitedll-3_6_12.zip and unzipped into C:\ruby\bin
and then ran
2.  gem install sqlite3-ruby -v 1.2.3

Rails Sucks

I've just started to learn Ruby on Rails (RoR). Got stuck when downloading rails behind a firewall. I wonder why Rails has poor documentation regarding the download steps.

Finally I manged to download rails by setting the following ENV_VARIABLE in Windows environment.

HTTP_PROXY=http://user:pwd@host:port

Even more disgusting is the fact, that I needed to change my password couple of times, since my credentials had special characters like @, %, !. Obviously, Rails hated this.