0

I am in rails setup hell.

I tried to make an app 2 years ago and after endless problems with it, I tried to make a fresh app and start again. I"m now having the same problem I had the first time around in getting the pg database setup, but none of the solutions offered for the first problem are working this time. My post about the problem the first time is here: Installing PG gem on OS X - failure to build native extension

Currently - I'm getting this error:

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.

I have tried uninstalling and reinstalling pg. I have tried installing with home-brew. I have tried all of the suggestions in the previous post I wrote about this problem with my first app. I've tried the solutions in this post: Ruby/PgSQL error on Rails start : cannot load such file -- pg_ext (LoadError)

Each time, the gem installs correctly. It's just I can't start the server or do anything from the command line - this error keeps coming up.

One of the steps I tried involved adding this to my command line. It's a straight copy & paste. I don't know what it means. I'm wondering if its a source of my issue:

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin

When I try:

rake rails:update:bin

I get this error:

rake aborted!
LoadError: cannot load such file -- nokogiri/nokogiri

Does anyone know how to solve this problem? I'm in rails hell!

Community
  • 1
  • 1
Mel
  • 2,481
  • 26
  • 113
  • 273
  • Before gem, did you installed postgres ? `brew install postgresql` ? – Dusht Dec 03 '15 at 10:22
  • installed and removed several times – Mel Dec 03 '15 at 10:25
  • As I remeber, I never had to change PATH after installing postgres with homebrew – fabien-michel Dec 03 '15 at 10:30
  • its one of the steps in one of the solutions i tried (from the attached post) – Mel Dec 03 '15 at 10:31
  • Forget about gems and rails for the time being: can you connect to postgres on the command line, and make a database in it? – Max Williams Dec 03 '15 at 10:34
  • Have you installed 'nokogiri' gem? – user3506853 Dec 03 '15 at 10:40
  • Hi Max. how can i test that from the command line? – Mel Dec 03 '15 at 10:49
  • I also lived the same problems you got here. My solution was to create the project at the very beginning with postgres doing this: `rails new myapp -d postgresql` This will generate your app with postgres by default. Doing this you get saved from all the configuration stuff when switching from sqlite to postgres (btw never works, at least for me). – JuanM. Dec 03 '15 at 13:49

1 Answers1

0

A similar issue is occur by a user. Please have look to this link. Hope this may helpful!!

Error message: Make sure that `gem install pg -v '0.18.1'` succeeds before bundling

Community
  • 1
  • 1
user3506853
  • 814
  • 5
  • 3