97
votes
8answers
38k views

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

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 ...
3
votes
2answers
6k 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. ...
1
vote
2answers
592 views

Postgres: creating a username

I'm trying to get started with Postgres on Rails apps on Mac. I made a new rails app called "shawsome" and in the database.yml file it created this development: adapter: postgresql encoding: ...
5
votes
3answers
4k 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
1k 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 ...
4
votes
2answers
713 views

Ruby on Rails+PostgreSQL: usage of custom sequences

Say I have a model called Transaction which has a :transaction_code attribute. I want that attribute to be automatically filled with a sequence number which may differ from id (e.g. Transaction with ...
6
votes
1answer
1k views

Error when creating unaccent extension on PostgreSQL

I am trying to configure PostgreSQL to use fulltext search in my rails app as mentioned in this Railscast. I am using a fresh Ubuntu 12.04 server running PostgreSQL 9.1.5 installed using apt-get with ...
4
votes
3answers
2k 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 ...
2
votes
2answers
2k views

pg gem install on Mac OS Lion with rvm

212-178-13-214:~ igorfedoronchuk$ gem install pg Building native extensions. This could take a while... ...
1
vote
3answers
2k views

Postgresql adapter (pg): could not connect to server

I get this error every this I run my Rails app (It cannot connect to my local Postgresql) /Users/leonardo/.rvm/gems/ruby-1.9.3-p362/gems/activerecord-3.2.11/lib/ ...
1
vote
1answer
227 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 ...