205
votes
17answers
83k views

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

I am using rails 3.1 pre version. I like to use PostgreSQL but the problem is installing the pg gem. It gives me the following error: demonchand@system-001:~/exercise/personal/pro$ gem install pg ...
6
votes
2answers
15k views

Rails: rake db:create:all fails to connect to PostgreSQL database

I am trying to create a Rails app that uses PostgreSQL. Here is a description of what I did. PostgreSQL setup: I installed PostgreSQL 9.1.3 via the ppa:pitti/postgresql maintained by Martin Pitt. ...
7
votes
4answers
6k views

Batch insertion in rails 3

I want to do a batch insert of few thousand records into the database (POSTGRES in my case) from within my Rails App. What would be the "Rails way" of doing it? Something which is fast and also ...
8
votes
3answers
7k views

rspec returns “PG::Error: ERROR: relation ”table_name“ does not exist”

Environment is REE(2011.12) on rvm, rspec 2.8.0, rails 3.0.6, and pg 0.13.2. Using PostgreSQL 8.3.17 on CentOS 5.6. The db:migrate have work correctly. But rspec have got following error. 1) ...
5
votes
1answer
2k views

Rails doesn't convert timezone (PostgreSQL)

I have a problem with timezones and a postgresql db (Rails 3.0.4, PostgreSQL 9.0). I'm using a custom scope, in which I append some conditions, do joins etc.pp. The problem is, that Rails don't ...
9
votes
3answers
3k views

Rspec: How to supress warnings and notices when running tests?

I was using Mysql database before and decided to switch to Postgresql and now, when I run my tests using rspec, I getting a lot of warnings and notices. WARNING: there is already a transaction in ...
1
vote
1answer
391 views

Newly assigned Sequence is not working

In PostgreSQL, I created a new table and assigned a new sequence to the id column. If I insert a record from the PostgreSQL console it works but when I try to import a record from from Rails, it ...