pg

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

 ̄綄美尐妖づ 提交于 2019-11-28 19:26:33
问题 $ 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 builder (3.0.4) Using activemodel (3.2.8) Using erubis (2.7.0) Using journey (1.0.4) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.2) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.3) Using actionpack (3.2.8) Using mime-types (1

gem install pg can not bind to libpq

时光总嘲笑我的痴心妄想 提交于 2019-11-28 18:19:18
After upgrading to Ruby 1.9.3 (from 1.9.2 using system RVM) on Ubuntu 10.04.3, I removed all of my gems, and attempted to reinstall pg (ala bundle install pg ). It then threw an error and informed me that I should look at mkmf.log, both of which are included in this gist: https://gist.github.com/d05a81701d968895c730 libpq-dev, libpq5, and postgresql-client are all installed and working correctly. Pointing gem at pg_config, and the include and bin directories directly does not appear to change anything. I've seen several questions about similar error messages around stackoverflow, and the rest

Installing pg gem; ERROR: Failed to build gem native extension

て烟熏妆下的殇ゞ 提交于 2019-11-28 17:17:26
After updating to OS X 10.9 Mavericks I tried to start a Rails 3 app, but the connection to the PG database was not working. Checking on PGAdmin III, the database is still there and it works fine. So I tried to reinstall the pg gem: gem uninstall pg gem install pg But the last command doesn't succeed, and gives the following error: Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /Users/XXX/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for pg_config... yes Using config values from /usr/local/bin/pg_config

ActiveRecord::StatementInvalid: PG InFailedSqlTransaction

血红的双手。 提交于 2019-11-28 16:56:53
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 transaction block Any ideas folks regarding the issue. B Seven None of the other answers fix the root cause of the issue. The problem is that when Postgres raises an exception, it poisons future transactions on the same connection. The fix is to rollback the offending transaction: begin ActiveRecord...do something... rescue Exception => e puts "SQL error in #{

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

一曲冷凌霜 提交于 2019-11-28 16:45:18
问题 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 install pg gem using: gem install pg Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/tusharkhatiwada/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg

connection.select_value only returns strings in postgres with pg gem

心已入冬 提交于 2019-11-28 12:10:28
I'm converting a rails app from using mysql (mysql2 gem) to postgres (pg gem). With mysql, ActiveRecord::Base.connection.select_value calls return values typed according to the data, for example: > ActiveRecord::Base.connection.select_value("SELECT COUNT(*) FROM errors") => 86 > ActiveRecord::Base.connection.select_value("SELECT exception FROM errors where id=565") => "TechTalk.Genome.SqlExecutionException" > ActiveRecord::Base.connection.select_value("SELECT id FROM errors where id=565") => 565 However, with postgres, connection.select_value always returns a string: > ActiveRecord::Base

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

亡梦爱人 提交于 2019-11-28 04:42:58
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 view the db ok using PgAdmin-III. I'd rather not have the password in database.yml as other machines using this app don't have/need it, so it seems likely to be something about my Pg install. Rodrigo Zurek You need to change your change your pg_hba.conf . Here's an example of mine: pg_hba.conf : TYPE DATABASE USER ADDRESS METHOD host all all 127.0.0.1

gem install pg doesn't work on OSX Lion

南楼画角 提交于 2019-11-28 03:29:01
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 postgresapp.com. But when I try to install the pg gem, I get a failure: $ gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /Users/disaacs/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb

Installing pg gem; ERROR: Failed to build gem native extension

给你一囗甜甜゛ 提交于 2019-11-27 20:05:16
问题 After updating to OS X 10.9 Mavericks I tried to start a Rails 3 app, but the connection to the PG database was not working. Checking on PGAdmin III, the database is still there and it works fine. So I tried to reinstall the pg gem: gem uninstall pg gem install pg But the last command doesn't succeed, and gives the following error: Building native extensions. This could take a while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /Users/XXX/.rvm/rubies/ruby-1.9.3

Postgresql adapter (pg): could not connect to server

六月ゝ 毕业季﹏ 提交于 2019-11-27 11:11:11
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 not connect to server: No such file or directory (PG::Error) Is the server running locally and accepting connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"? I'm using Postgres.app that it's correctly running. If I run $ psql I can login properly to Postgresql console. $ which psql /Applications/Postgres.app/Contents/MacOS/bin/psql