简体   繁体   中英

sudo gem install pg -v '0.18.4' does not work on macos sierra high (RoR)

I have difficulty trying to gem install pg -v '0.18.4' that is needed for my ruby on rails "bundle install" app which was developed about 3 years back.

sudo gem install pg -v '0.18.4'

it complaints below:

conftest.c:15:13: error: conflicting types for 'PQconnectdb'
extern void PQconnectdb();

full execution error https://gist.github.com/axilaris/f521685f4e5c7a8e5653bf672af1efa7

mkmf.log - https://gist.github.com/axilaris/2e4cf2729b34d751c1ce76b046a0b21c

My environment is as below:

Postgres 9.4.0.1
MacOs Sierra High 10.13.1

$ ruby -v
ruby 2.3.3p222 (2016-11-21 revision 56859) [universal.x86_64-darwin17]

$ rails -v
Rails 5.1.4

I tried to install brew install libpqxx it doesnt work

Here are some related stackoverflow:

Can't find the 'libpq-fe.h header when trying to install pg gem

Impossible to Install PG gem on my mac with Mavericks

I want to make sure I install - sudo gem install pg -v '0.18.4'. Since on production it should be running that as well. I dont want to break anything that is running in the production ubuntu server. Currently for this question, I am setting up the environment on my mac for development to try to make a code fix.

FYI, I'ved tried on 2 macs. one original development mac which upgraded to sierra high, another is a new formatted mac with newly installed sierra high.

Try this

ARCHFLAGS="-arch x86_64" bundle install

For RMagick do this

brew install imagemagick@6
brew link --force imagemagick@6

Please let me know if any error occur in while installing rmagick.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM