0

I am new to ruby on rails and I just downloaded a new Rails project directory that my friend sent to me. I put that directory on the Desktop and cd into it. I want to play with the code on my local host to learn from the code. But when I tried to run "rails s", it gives me the error saying that

"Could not find pg-0.17.1 in any of the sources
 Run `bundle install` to install missing gems."

So I ran "bundle install", then it gave the error that

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

I googled the problem for a while but I did not find any solution.. "rails s" stills works fine in my own project's directory. But how can I make it work in the directory I just downloaded? Am I supposed to do some other setup or installing?

Shawn Li
  • 99
  • 2
  • 13
  • Can you specify OS you are using? For instance installing gems on Windows it is very tricky. On linux box you need to install PostgreSQL header files, to compile gem. – sashaegorov Nov 13 '14 at 21:57

2 Answers2

1

Make sure you have installed postgres on your local machine.

gem install pg --with-pg-config works, bundle fails

Community
  • 1
  • 1
hraynaud
  • 681
  • 7
  • 15
0

Here how I made development environment on my Mac.

Install PostgreSQL via Homebrew package manager brew install postgresql. This should install all necessary header files for gem compilation.

sashaegorov
  • 1,821
  • 20
  • 26