Tyler
Tyler

Reputation: 19848

Geokit-rails fresh setup, Could not find table 'locations' Rails 5

I followed the directions here but when I run Location.all, I get

ActiveRecord::StatementInvalid: Could not find table 'locations'

Are there any extra setup steps or configuration required for using geokit-rails in a Rails 5 app? Does it have anything to do with the fact I'm still using Sqlite and haven't switched databases yet?

Upvotes: 0

Views: 86

Answers (1)

Pavan
Pavan

Reputation: 33542

ActiveRecord::StatementInvalid: Could not find table 'locations'

The documentation refers to an example of how to setup geokit-rails in the model. The gem doesn't serve/ship with a ready-made table. You should generate the table instead. Assuming you already have Location model in your app, then generate a migration to create locations table

rails g migration create_locations

and do rake db:migrate

Upvotes: 1

Related Questions