title: Error message: Make sure that `gem install pg -v '0.18.1'` succeeds before bundling
body: <p>i have a problem with ruby. I tried a lot but nothing works for me. </p>
  
  <p>When i want to start the rails server, i get this error message: </p>
  
  <blockquote>
    <p>An error occurred while installing pg (0.18.1), and Bundler cannot continue.
    Make sure that "gem install pg -v '0.18.1" succeeds before bundling.</p>
  </blockquote>
  
  <p>This is what i tried already: </p>
  
  <pre><code>sudo install gem
  bundle install
  bundle install --path vendor/cache
  gem install pg -v '0.18.1'
  </code></pre>
  
  <p>When i try <code>gem install pg -v '0.18.1'</code>i get this error message: </p>
  
  <blockquote>
    <p>Could not find gem 'pg (>= 0) ruby' in any of the gem sources listed in your Gemfile or installed on this machine.
    Run <code>bundle install</code> to install missing gems.</p>
  </blockquote>
  
  <p>But <code>bundle install</code>doesn't work either. I get this error message:</p>
  
  <blockquote>
    <p>An error occurred while installing pg (0.18.1), and Bundler cannot continue.
    Make sure that <code>gem install pg -v '0.18.1'</code> succeeds before bundling.</p>
  </blockquote>
  
  <p>I also tried to start the server in a new ruby project. </p>
  
  <p>Nothing helps.. </p>
  
  <p>Thanks for your help!</p>
  
  <p>These are my changes in my Gemfile: </p>
  
  <pre><code>group :production do
     gem 'pg'
     gem 'rails_12factor'
   end
  
  group :development do
     gem 'sqlite3'
   end
  </code></pre>