Ruby Postgres script
Swami Nikhilaananda said: " Ruby is a gem of a language " There was a very simple requirement that I had - I wanted to write a script to update a postgres table. On looking up quite a few resources also, I was unable to solve the issue that I was facing. Let me put down the completely stripped down version of the script here first... #!/usr/bin/ruby require 'postgres' conn = PGconn.connect("localhost", 5432, '', '', "tblName", "username", "password") puts conn This script is the typical script that you will find on looking up any site. However, the error that you will face on running this is the following: ... `require': no such file to load -- postgres (LoadError) ... This was quite annoying... Finally I discovered the required solution. So, I thought that this needs to be shared. Though it appears to be trivial, it is definitely not something that I could find with ease :) #!/usr/bin/ruby ...