Questions tagged [pg]

'pg' is the name of an extension for Ruby that provides access to libpq, the C application programmer’s interface to the PostgreSQL RDBMS.

pg is the name of an extension for Ruby that provides access to libpq, the C application programmer’s interface to the PostgreSQL RDBMS. It provides a relatively complete mapping, including both synchronous and asynchronous query interfaces, notifications, support for the COPY command, and m17n support under Ruby 1.9.

It includes full RDoc API documentation, a copy of which can be found on the maintainer's site.

It is currently maintained and developed by Michael Granger.

854 questions
969
votes
49 answers

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: …
demonchand
  • 11,091
  • 6
  • 21
  • 25
309
votes
19 answers

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…
palani
  • 4,661
  • 8
  • 31
  • 36
124
votes
16 answers

rails install pg - Can't find the 'libpq-fe.h header

$ sudo bundle install Result Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Using rake (0.9.2.2) Using i18n (0.6.1) Using multi_json (1.3.6) Using activesupport (3.2.8) Using…
Arthur Yakovlev
  • 8,933
  • 8
  • 32
  • 48
99
votes
16 answers

Rails 3 - can't install pg gem

When I try to run bundle (bundle install), I all the time get Installing pg (0.13.2) with native extensions Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/ryan/.rvm/rubies/ruby-1.9.2-p290/bin/ruby…
user984621
  • 46,344
  • 73
  • 224
  • 412
84
votes
12 answers

ActiveRecord::StatementInvalid: PG InFailedSqlTransaction

I am trying to create an ActiveRecord Object.But I'm getting this error while creating it. (0.1ms) ROLLBACK ActiveRecord::StatementInvalid: PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of…
untwal
  • 1,017
  • 1
  • 9
  • 17
79
votes
18 answers

gem install pg --with-pg-config works, bundle fails

WhenI run (as root) gem install pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config I get the following output: #-> gem instal pg -v '0.12.0' -- --with-pg-config=/usr/pgsql-9.1/bin/pg_config Building native extensions. This could…
YuKagi
  • 2,451
  • 3
  • 21
  • 26
76
votes
8 answers

Cannot install pg gem in Mavericks with Postgres.app

I am trying to install the pg gem for use with Postgres.app on my local machine. I am running Mavericks. Postgres.app is installed and running fine, but I cannot get the gem to work. I've done the following: Used the command 'env ARCHFLAGS="-arch…
blundin
  • 1,603
  • 3
  • 14
  • 29
66
votes
15 answers

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/ active_record/connection_adapters/postgresql_adapter.rb:1208:in `initialize': could…
sparkle
  • 7,530
  • 22
  • 69
  • 131
46
votes
11 answers

ERROR: Failed to build gem native extension on Mavericks

I'm attempting to run bundle in my Rails project on OSX 10.9. It fails when getting to the pg gem with this error: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. …
Kyle Decot
  • 20,715
  • 39
  • 142
  • 263
35
votes
3 answers

Installing the PostgreSQL gem with 'gem pq' fails with ERROR: Failed to build gem native extension

I am learning Ruby on Rails and trying to develop an application. In my application I am trying to use the default SQLite database in the Development Mode and PostgreSQL in the Production Mode. But I'm getting the following error while trying to…
Tushar Khatiwada
  • 2,019
  • 2
  • 20
  • 32
34
votes
2 answers

insert statement in postgres for data type timestamp without time zone NOT NULL,

Database noob alert: I am trying to insert into a postgres table. The field that I would like to insert in is called make_date. The field type is timestamp without time zone NOT NULL, How do I insert today's date in there? Like right now's date and…
Doublespeed
  • 1,153
  • 4
  • 16
  • 29
31
votes
13 answers

gem install pg doesn't work on OSX Lion

There are variations of this question bouncing around SO, but none of them seem to have an answer that solves my problem. I am running OSX Lion (10.7.3). The latest XCode is installed. I've installed Postgres using the Postgres.app package from…
Dave Isaacs
  • 4,499
  • 6
  • 31
  • 44
29
votes
9 answers

Stop postgreSQL service on Mac via terminal

Running postgreSQL 9.4.5_2 currently I have tried pg_ctl stop -W -t 1 -s -D /usr/local/var/postgres -m f Normally no news is good news but after I will run pg_ctl status -D /usr/local/var/postgres and get pg_ctl: server is running (PID: 536) I…
Andrew M
  • 1,083
  • 2
  • 12
  • 15
27
votes
7 answers

“Error: Please install pg package manually” when trying to run “npm run serve:dev”?

I'm trying to run an app with script npm run serve:dev but it gives an error Error: Please install pg package manually when trying to run npm run serve:dev I already tried npm install -g pg','npm install -g pg-hstore ERROR: kshitij-mag@0.1.0…
qroach
  • 371
  • 1
  • 3
  • 4
26
votes
4 answers

Trying to set up postgres for ror app, getting error - fe_sendauth: no password supplied

Getting: An error has occurred: Error connecting to the server: fe_sendauth: no password supplied Settings in database.yml are the same as the app setup on other machines. How can I set things up so that I don't need a password hardcoded? I can…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
1
2 3
56 57