On Tue, Oct 23, 2012 at 4:11 PM, Brian <[address removed]>
When you're using PostGIS you need to make sure when you create a new database it uses the PostGIS database template.
createdb -T my_postgis_template my_new_db_name
Hope that helps in the future.
correct. the problem was that I had a postgis template created, but I wasn't using it.
However, with out even thinking about it, I was doing what you just said manually.
setting the correct template in database.yml lets you use rake db:create without issues when you get to rake db:test:prepare
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed] (mailto:[address removed]))
On Tuesday, October 23, 2012 at 3:58 PM, Andrew McElroy wrote:
> At the last rails meetup I brought up a question about making rails + postgresql + postGIS + rspec work.
> It turns out that if you are using the pg gem, it supports template: option in database.yml.
> I wish this was better documented.
> It's completely obvious now that I figured it out, but I figured it doesn't hurt to post the answer.
> If you ever run into a situation where postgres is missing datatypes like geometry in my case, this is very likely the answer.
> I kind of wish that the pg gem would auto generate the template option in database.yml on a new rails project so that would explicitly know which template (if more than one exist for a user) you are using.
> The specific error message I was getting was: PG::Error: ERROR: relation "geometry_columns" does not exist.
> None of the current stackover flow answers that key on that error mention setting the template flag.
> Andrew McElroy
> This message was sent by Andrew McElroy ([address removed] (mailto:[address removed])) from The Nashville Ruby on Rails Meetup Group (http://www.meetup.com/nashvillerails/).
> To learn more about Andrew McElroy, visit his/her member profile (http://www.meetup.com/nashvillerails/members/10749993/)
> Set my mailing list to email me As they are sent (http://www.meetup.com/nashvillerails/list_prefs/?pref=1) | In one daily email (http://www.meetup.com/nashvillerails/list_prefs/?pref=2) | Don't send me mailing list messages (http://www.meetup.com/nashvillerails/list_prefs/?pref=0)
> Meetup, PO Box 4668 #37895 New York, New York[masked] (#) | [address removed] (mailto:[address removed])
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Brian ([address removed]) from The Nashville Ruby on Rails Meetup Group.
To learn more about Brian, visit his/her member profile: http://www.meetup.com/nashvillerails/members/3438546/
Set my mailing list to email mehttp://www.meetup.com/nashvillerails/list_prefs/?pref=1
As they are sent
In one daily email
Don't send me mailing list messages
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]