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

How to rollback a specific migration?

I have the following migration file db\migrate\20100905201547_create_blocks.rb How can I specifically rollback that migration file? 15 s 15 rake db:rollback STEP=1 Is a way to do this, if the migration you want to rollback is the last one applied. You can substitute 1 for however many migrations you want to go back. For example: rake … Read more

Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails

I’m getting the error: FATAL: Peer authentication failed for user “postgres” when I try to make postgres work with Rails. Here’s my pg_hba.conf, my database.yml, and a dump of the full trace. I changed authentication to md5 in pg_hba and tried different things, but none seem to work. I also tried creating a new user … Read more

Why do people use Heroku when AWS is present? What distinguishes Heroku from AWS? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago. Improve this question I’m a beginner RoR programmer who’s planning to deploy my app using Heroku. Word from my … Read more

How to understand nil vs. empty vs. blank in Ruby

I find myself repeatedly looking for a clear definition of the differences of nil?, blank?, and empty? in Ruby on Rails. Here’s the closest I’ve come: blank? objects are false, empty, or a whitespace string. For example, “”, ” “, nil, [], and {} are blank. nil? objects are instances of NilClass. empty? objects are … Read more