Stop postgreSQL service on Mac via terminal
Sadly none of the previous answers help me, it worked for me with: brew services stop postgresql Cheers
Sadly none of the previous answers help me, it worked for me with: brew services stop postgresql Cheers
I finally found the cause of the problem! Though I am still uncertain how this problem came about. Look at the contents of the mkmf.log file that is created when my install command fails (see my original post). It logs an attempt to run the following command /usr/bin/gcc-4.2 …and so on… There is no /usr/bin/gcc-4.2 … Read more
Use now() or CURRENT_TIMESTAMP.
If you are using Ubuntu try to install following lib file sudo apt-get install libpq-dev and then gem install pg worked for me.
Also make sure that you’ve upgraded Xcode to re-install command line tools on Mavericks. In terminal type: xcode-select –install Then follow the prompts.
Try adding host: localhost to your database.yml. (Based on: https://stackoverflow.com/a/10793186/919641)
You probably have the wrong path for –with-pg-config, check if it’s actually there. You can find the correct path to pg_config with: find /Applications -name pg_config In the latest Postgres.app Version the path is: gem install pg — –with-pg-config=/Applications/Postgres.app/Contents/Versions/9.5/bin/pg_config
Have you tried running this before running bundle install? bundle config build.pg –with-pg-config=/usr/pgsql-9.1/bin/pg_config See http://bundler.io/v1.3/bundle_config.html
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 #{ __method__ }” ActiveRecord::Base.connection.execute ‘ROLLBACK’ raise e … Read more
if you are running on Linux you may be interested in what worked for me: sudo apt-get install postgresql sudo apt-get install libpq-dev Then gem install pg then bundle install src: http://wikimatze.de/installing-postgresql-gem-under-ubuntu-and-mac