0

New to coding and just installing Ruby on Rails and getting this error message when trying to create rails app: An error occurred while installing pg (0.18.4), and Bundler cannot continue. Make sure that gem install pg -v '0.18.4' succeeds before bundling. please help.

Gumbo
  • 643,351
  • 109
  • 780
  • 844

4 Answers4

1

If you are using Ubuntu, the answer from Mourndark's comment is pretty accurate. Install libpq-dev and you will be ready to go.

Russia Must Remove Putin
  • 374,368
  • 89
  • 403
  • 331
jdmaster
  • 11
  • 1
0

You need to install the postgresql database.

Please check this question: An error occurred while installing pg (0.17.1), and Bundler cannot continue

Community
  • 1
  • 1
0

Unclear what environment you are working in, but this post should contain a majority of the possible fixes (you most likely need to install PostgreSQL locally) in addition to what Celso Martins posted: Installing PG gem on OS X - failure to build native extension

Community
  • 1
  • 1
  • am getting this Warning: postgresql-9.4.5_2 already installed, it's just not linked – Brendan Mosweu Jan 06 '16 at 20:01
  • Would you mind posting the entire output? @BrendanMosweu – Remain Zany Jan 06 '16 at 20:12
  • An error occurred while installing pg (0.18.4), and Bundler cannot continue. Make sure that `gem install pg -v '0.18.4'` succeeds before bundling. – Brendan Mosweu Jan 06 '16 at 20:19
  • What method did you use to install PostgreSQL? MacPorts? @BrendanMosweu – Remain Zany Jan 06 '16 at 20:23
  • PostgreSQL You can install PostgreSQL server and client from Homebrew: brew install postgresql Once this command is finished, it gives you a couple commands to run. Follow the instructions and run them: # To have launchd start postgresql at login: ln -sfv /usr/local/opt/postgresql/*plist ~/Library/LaunchAgents # Then to load postgresql now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist By default the postgresql user is your current OS X username with no password. For example, my OS X user is named chris so I can login to postgresql with that username. – Brendan Mosweu Jan 06 '16 at 20:26
  • I also tried to fix the problem by installing using Graphical installer – Brendan Mosweu Jan 06 '16 at 20:28
  • The location of pg_config is likely the issue. Check these posts: http://stackoverflow.com/questions/19625487/impossible-to-install-pg-gem-on-my-mac-with-mavericks – Remain Zany Jan 06 '16 at 20:30
  • http://stackoverflow.com/questions/9234960/gem-install-pg-with-pg-config-works-bundle-fails @BrendanMosweu – Remain Zany Jan 06 '16 at 20:30
0

I executed sudo apt-get remove libpq5 and sudo apt-get install libpq-dev and after bundle install