正在运行Geometry::Point.new(1,1)
在开发中一切顺利,同时在我的生产服务器中它给出了 uninitialized constant MyControllerController::Geometry
在我的生产服务器上,我检查了这一点:
bundle exec bundle show geometry
返回
/path_to_app/shared/bundle/ruby/2.0.0/gems/geometry-6.2
bundle exec bundle show ruby-geometry
得到
/path_to_app/shared/bundle/ruby/2.0.0/gems/ruby-geometry-0.0.5
在 dev 中,甚至 Point(1,1)
可以工作,不需要模块和"new",这也会在生产中中断。返回:NameError: uninitialized constant Point
我已经尝试过require 'geometry'
和include Geometry
,但都失败
有人可以帮我吗?
最佳答案
确保将 ruby-geometry
gem 放入 Gemfile 中,如下所示:
gem 'ruby-geometry', require: 'geometry'
我可能应该在 gem 的 README 文件中进一步强调它。
关于ruby-on-rails - Rails Ruby Geometry Gem 投入生产,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23879582/