【发布时间】:2015-05-16 01:27:20
【问题描述】:
我在本地计算机上的 Web 应用程序中使用了 geokit-rails gem,我按照他们的 github 存储库中的步骤操作,它在我的本地计算机上完美运行,但是一旦我在 openshift 远程服务器上部署了我的应用程序。它似乎不起作用。 openshift ruby.log 文件给出以下错误
[2015-05-15 21:10:52.1608 54455/7fec5b5fe700 代理/HelperAgent/RequestHandler.h:1971]:[客户端 20] 无法签出会话。启动 Web 应用程序时发生错误。 错误页面: 未定义的方法
acts_as_mappable' for Group (call 'Group.connection' to establish a connection):Class (NoMethodError) /var/lib/openshift/555682cde0b8cd2874000091/app-root/runtime/repo/vendor/bundle/ruby/gems/activerecord-4.2.1/lib/active_record/dynamic_matchers.rb:26:inmethod_missing' /var/lib/openshift/555682cde0b8cd2874000091/app-root/runtime/repo/app/models/group.rb:2:in `'
我确定我添加了 宝石'地理编码器' 宝石'geokit-rails' 宝石'gmaps4rails' 到我的gemfile,但问题仍然存在。我从我的应用程序中删除了对该方法的所有与 geokit 相关的代码的调用,它工作正常,所以问题一定出在其中。我关注了这个链接 Rails 3.1.0, geokit, with error acts_as_mappable 和这个链接 Geokit in Ruby on Rails, problem with acts_as_mappable 但它没有解决任何问题。
我使用的是 Rails 4.2.1
提前致谢
【问题讨论】:
-
geokit-rails 有什么作用?我在我的应用程序中使用地图,我只有 gem 'geocoder' 和 gem 'gmaps4rails'。
-
这是我用的demo——我记得在做教程的时候使用acts_as_mappable,后来发现已经被贬值了。 youtube.com/watch?v=R0l-7en3dUw&spfreload=10
-
我认为 OpenShift Online 目前不支持 rails 4.2(您使用的是什么版本的 ruby?)可能与您的错误有关。当您使用 git push 部署应用程序时,您是否遇到任何其他错误?
-
不成功了
-
我在尝试从
geokit-rails3升级旧网站时收到此错误。当我需要geokit-rails时,我会不小心将其替换为 Gemfile 中的geokit。
标签: ruby-on-rails openshift geokit