title: Sinatra/ActiveRecord + Heroku generating errors
body: <p><strong>SCENARIO:</strong><br>
  I'm using Sinatra + Sinatra/Active Record + SQLite3 for my local development. I am aware that when I push to Heroku that it uses Postgresql. Which is fine because I am using active record and I should have no problem.</p>
  
  <p><strong>APP.RB File</strong>  </p>
  
  <pre><code>require 'rubygems'
  require 'sinatra'
  require 'sinatra/activerecord'
  require 'open-uri'
  require 'uri'
  require 'nokogiri'
  
  configure :development do
    set :database, 'sqlite://development.db'
  end
  
  configure :test do
    set :database, 'sqlite://test.db'
  end
  
  configure :production do
    db = URI.parse(ENV['DATABASE_URL'] || 'postgres://localhost/mydb')
  
    ActiveRecord::Base.establish_connection(
      :adapter  =&gt; db.scheme == 'postgres' ? 'postgresql' : db.scheme,
      :host     =&gt; db.host,
      :username =&gt; db.user,
      :password =&gt; db.password,
      :database =&gt; db.path[1..-1],
      :encoding =&gt; 'utf8'
    )
  end
  
  class Picture &lt; ActiveRecord::Base
  
  end
  
  get '/' do
    @test = Picture.find(:all)
    erb :index
  end
  </code></pre>
  
  <p><strong>ERRORS</strong><br>
  When I try <code>heroku rake db:migrate</code> I get the following error...  </p>
  
  <pre><code>DEBUG -- : NoMethodError: undefined method `values' for #&lt;PGresult:0x00000002b24d08&gt;: SHOW client_min_messages   
  
  DEBUG -- : PGError: ERROR:  invalid value for parameter "client_min_messages": ""
  </code></pre>
  
  <p>Then I thought ok no worries I'll try this heroku feature of pushing the data from my local sqlite3 <code>development.db</code> into my heroku production db. So I did <code>heroku push:db sqlite://development.db</code>  and <strong>success the data is in.</strong></p>
  
  <p>I then restarted the app and pushed further commits but I CANNOT access anything to do with ActiveRecord. If I make a basic query of <code>Picture.find(:all)</code> I get the same <code>DEBUG</code> error.</p>
  
  <p>Is my <code>configure :production</code> messing me up?
  Any recommendations?</p>