Syntax errors on Heroku, but not on local server (postgresql related?)

Posted by Phil_Ken_Sebben on Stack Overflow See other posts from Stack Overflow or by Phil_Ken_Sebben
Published on 2010-12-26T09:58:40Z Indexed on 2010/12/26 18:54 UTC
Read the original article Hit count: 157

I'm trying to deploy my first app on Heroku (rails 3). It works fine on my local server, but when I pushed it to Heroku and ran it, it crashes, giving a number of syntax errors. These are related to a collection of scopes I use like the one below:

  scope :scored, lambda { |score = nil|       
    score.nil? ? {} : where('products.votes_count >= ?', score)
  }

it produces errors of this form:

"syntax error, unexpected '=', expecting '|' "

"syntax error, unexpected '}', expecting kEND"

Why is this syntax making Heroku choke and how can I correct it? Thanks!

EDIT: I was using sqlite on my local machine and Heroku does not support that. Trying to make sure the db is properly configured for PG. I believe I have done that by specifying in the gemfile that sqlite only be used in development. Yet I still get these syntax errors, that interrupt even the db:migrate.

EDIT: So now it seems more likely that my scope syntax doesn't work in postgreSQL. Does anyone know how to convert this properly?

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about syntax