Model Update_attribute Update_attributes

Lot of people might have a confusing between the functionality of update_attribute and update_attributes. The purpose of these functions can be understood from their name itself. the first one update_attribute would update a single attribute of the model

Make Self Executing Ruby Scripts Linux

To run a ruby program we use the command ruby

ruby program_name.rb.

Ruby being an interpreter style language, each line is interpreted(read) one after the other and executable object code file is created for reuse like in case of compiler languages C, C++, etc.. To run a ruby code you need a ruby interpreter installed in your system.

Setup Postgresql and Its Libraries to Work With Rails

Recently lot of people have been asking me why they are not able to install the pg (PostgreSQL) gem even after installing PostgreSQL server in their system?

Well the answer is simple, the pg gem, requires the PostgreSQL development libraries to build native extensions to communicate with the PostgreSQL server. Native extensions refer to building ruby extensions or wrappers for existing C or C++ library.

One can install the development libraries of PostgreSQL by installing the libpg-dev package.

Install Ruby via Source Ubuntu

This blog post is for old style programmer who wish to install ruby via compiling the source code, like how I do it. This blog post is written in a just to know basis.

The source code of ruby can be downloaded from ruby’s official website http://www.ruby-lang.org/en/downloads/.

Dependency for Ruby and Ruby on Rails : libreadline, libyaml, libxml, libssl, zlib1g.

In ubuntu you can have these libraries installed via the command line ( or if you are so old fashion you may google and find the source code for these packages as well)

Store RPM Packages in Cache

Every time you download a RPM package for installation / updation via yum in Centos / Redhat system it gets deleted automatically after the procedure. Its a rather handy process by which your systems does not waste space storing the installation files.

Want to keep those packages in your system, and maybe create a local repository?

Well there are several ways. Simplest of them would be to edit the yum configuration file.