简体   繁体   English

Geokit-rails新设置,找不到表“ locations” Rails 5

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

I followed the directions here but when I run Location.all, I get 我按照这里指示进行,但是当我运行Location.all时,我得到了

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? 在Rails 5应用程序中使用geokit-rails是否需要任何额外的设置步骤或配置? Does it have anything to do with the fact I'm still using Sqlite and haven't switched databases yet? 这是否与我仍在使用Sqlite并且尚未切换数据库有关?

ActiveRecord::StatementInvalid: Could not find table 'locations' ActiveRecord :: StatementInvalid:找不到表的“位置”

The documentation refers to an example of how to setup geokit-rails in the model. 该文档引用了有关如何在模型中设置geokit-rails示例 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 假设您的应用程序中已有Location模型,然后生成迁移以创建locations

rails g migration create_locations

and do rake db:migrate 并做rake db:migrate

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM