How to install PostgreSQL’s pg gem on Ubuntu?

I’m trying to install PostgreSQL’s pg gem for Ruby. I issued the following command: gem install pg I installed Ruby 1.9.2 using RVM. The above command shows me the following error. The error is : Building native extensions. This could take a while… ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/User/.rvm/rubies/ruby-1.9.2-preview3/bin/ruby … Read more

Can’t find the ‘libpq-fe.h header when trying to install pg gem

I am using the Ruby on Rails 3.1 pre version. I like to use PostgreSQL, but the problem is installing the pg gem. It gives me the following error: $ gem install pg Building native extensions. This could take a while… ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/u/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb checking … Read more