pg

Error requiring pg under rvm with postgres.app

我只是一个虾纸丫 提交于 2020-01-11 09:11:26
问题 I'm using Postgres.app on OS X (10.8.3). I have modified my PATH so that the bin folder for the app is before all others. Rammy:~ phrogz$ which pg_config /Applications/Postgres.app/Contents/MacOS/bin/pg_config I have rvm installed and can install the pg gem without error, but when I go to require it I get an error: Rammy:~ phrogz$ gem -v 1.8.25 Rammy:~ phrogz$ gem install pg Fetching: pg-0.15.1.gem (100%) Building native extensions. This could take a while... Successfully installed pg-0.15.1

pg_config, ruby pg, postgresql 9.0 problem after upgrade, centos 5

不打扰是莪最后的温柔 提交于 2020-01-10 19:28:18
问题 After upgrade postgresql 8.1 to 9.0 ive noticed issues with libraries dependency. Postgresql works fine (connection, queries). yum list postgresql* Installed Packages postgresql.i386 9.0.0-1PGDG.el5 installed postgresql-debuginfo.i386 9.0.0-1PGDG.el5 installed postgresql-devel.i386 9.0.0-1PGDG.el5 installed postgresql-libs.i386 9.0.0-1PGDG.el5 installed postgresql-odbcng.i386 0.90.101-2.el5 installed postgresql-plruby.i386 0.5.1-5.el5 installed postgresql-server.i386 9.0.0-1PGDG.el5 install

UPDATE multiple rows from multiple params in nodejs/pg

半城伤御伤魂 提交于 2020-01-07 06:40:23
问题 I'm using NodeJS and pg with a PostgreSQL database as backend. Running single queries with Client.query works fine. However, I've got a challenge which I can solve in a simple and elegant way. I would like to run: UPDATE portfolios SET votes = $1 WHERE id = $2 from an array/list of: [{votes: 5, id: 1}, {votes: 15, id: 1}, {votes: 25, id: 2}] Can it be done in a single Client.query (or similar with pg), so I don't have to make a "for () { ... }"? 回答1: The driver must pass the query to

UPDATE multiple rows from multiple params in nodejs/pg

大城市里の小女人 提交于 2020-01-07 06:39:11
问题 I'm using NodeJS and pg with a PostgreSQL database as backend. Running single queries with Client.query works fine. However, I've got a challenge which I can solve in a simple and elegant way. I would like to run: UPDATE portfolios SET votes = $1 WHERE id = $2 from an array/list of: [{votes: 5, id: 1}, {votes: 15, id: 1}, {votes: 25, id: 2}] Can it be done in a single Client.query (or similar with pg), so I don't have to make a "for () { ... }"? 回答1: The driver must pass the query to

postgres no users or roles, can't create but works with rails?

僤鯓⒐⒋嵵緔 提交于 2020-01-05 08:55:22
问题 I'm trying to setup postgres on OSX. I was having problems with a rails app ('cannot connect to database') and reinstalled postgres with homebrew. I cannot issue postgres commands from terminal now though: $ sudo -u _postgres psql Password: psql: FATAL: role "_postgres" does not exist $ brew list autoconf libksba openssl python sqlite automake libtool ossp-uuid rbenv gdbm libyaml pkg-config readline libgpg-error mongodb postgresql ruby-build $ postgresql zsh: command not found: postgresql $

pg gem fails to install

寵の児 提交于 2020-01-04 19:41:04
问题 I'm trying to get Rails working with Cygwin using heroku but I'm running into problem when I do bundle install I'm pretty sure postgres is installed (I installed everything with 'postgres' in its title from Cygwin's setup.exe but am running into problems with gem install pg , and I can't make sense of the error messages. Apologies if this problem is trivial; it's my first time trying to learn RoR. Error log is below. Thanks in advance! /usr/bin/ruby.exe extconf.rb checking for pg_config...

rails pg db migration undefined method `database_authenticatable' for Devise Users

霸气de小男生 提交于 2020-01-02 08:17:30
问题 undefined method database_authenticatable' for #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition:0xd715388> The migration is: class DeviseCreateUsers < ActiveRecord::Migration def self.up create_table(:users) do |t| t.database_authenticatable :null => false t.recoverable t.rememberable t.trackable t.timestamps end add_index :users, :email, :unique => true add_index :users, :reset_password_token, :unique => true end def self.down drop_table :users end end 回答1: If I'm not

Postgresql adapter (pg): could not connect to server

痞子三分冷 提交于 2019-12-28 04:51:05
问题 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

PG::ConnectionBad: PQconsumeInput() SSL error: key values mismatch

↘锁芯ラ 提交于 2019-12-25 16:53:32
问题 When I open a certificate with OpenSSL::PKCS12, I lose the connection with my database and occur the error: PG::ConnectionBad: PQconsumeInput() SSL error: key values mismatch . I'm doing this: myuser@developer:~/myapp$ rails c 2.2.3 :001 > OpenSSL::PKCS12.new File.read('/local/to/mycert.pfx'), 'PASSWORD' => #<OpenSSL::PKCS12:0x000000072e6808 @key=#<OpenSSL::PKey::RSA:0x000000072e67e0>, @certificate=#<OpenSSL::X509::Certificate: subject=#<OpenSSL::X509::Name:0x000000072e6100>, issuer=#<OpenSSL

How to install PostgreSQL's pg gem on Ubuntu?

丶灬走出姿态 提交于 2019-12-25 02:47:05
问题 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 while... ERROR: Error installing pg: ERROR: Failed to build gem native extension. /home/User/.rvm/rubies/ruby-1.9.2-preview3/bin/ruby extconf.rb checking for pg_config... yes checking for libpq-fe.h... yes checking for libpq/libpq-fs.h... yes checking for