ERROR: Failed to build gem native extension on Mavericks

自作多情 提交于 2019-11-27 01:47:41

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.

For me it worked when I did:

brew install postgresql
Sayanee

this worked for me with Mavericks and the Postgresapp:

gem install pg -v '0.17.0' -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config

Try using the --with-pg-config argument:

bundle config build.pg --with-pg-config=/usr/pgsql-9.1/bin/pg_config

To show the path of the pg_config:

which pg_config

For Ubuntu users:

sudo apt-get install postgresql
sudo apt-get install libpq-dev

Then:

bundle install

For me using Mavericks, Rails 3.2.13, Ruby 2.0.0-p247, PostgreSQL 9.1, I needed todo this:

gem install pg -v '0.15.1' -- --with-pg-config=/Library/PostgreSQL/9.1/bin/pg_config

I've just got it running by doing

ARCHFLAGS="-arch x86_64" gem install pg

after installing posgres using brew

matheau

This worked for me on Mac OS X 10.9.3 and Postgres.app version 9.3.4.2:

1) Install Postgres.app

2) bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config

3) gem install pg -v '0.17.1'

4) bundle install

When i try to install

apt-get install libpq-dev

Failed to install, unmet dependencies problem, to solve

apt-get remove libpq5

then install

apt-get install libpq-dev

Finally solved the gem pg issue.

The following worked for me:

gem install pg -v '0.18.1' -- --with-pg config=/Library/PostgreSQL/9.3/bin/pg_config

You have to configure pg with your current version I used mine 9.4 version on Yosemite. Here is the following command

bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config 

You should use your own version

bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/(YOUR POSTGRES VERSION)/bin/pg_config 

then do

bundle install

An error occurred while installing debugger (1.6.5), and Bundler cannot continue. Make sure that `gem install debugger -v '1.6.5'` succeeds before bundling.

I was able to fix this error by rolling back to Ruby v2.0.0. I was running Ruby 2.1.1, which is not supported for this debugger version. Be sure to check your ruby version if you run into this issue as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!