将 JRuby/Rails 部署到 Glassfish:未定义的方法“bundle_path”对于捆绑器:模块
尝试访问我的应用程序时,我的 Glassfish 日志中显示以下错误:
Caused by: org.jruby.exceptions.RaiseException: (NameError) method 'to_yaml' not defined in Object
查看日志,我看到以下内容:
undefined method `bundle_path' for Bundler:Module
我确认 warble 确实将 Bundler gem 放入我的 .war 文件中。
(使用 ruby 1.9、rails 3.1、glassfish 3.0 和 3.1)
这也出现在 glassfish 日志中:
Policy Provider:Failed Permission Check: context (" myapp/myapp ") , permission (" (java.lang.reflect.ReflectPermission suppressAccessChecks) ") |#]
但是我已经验证在 server.policy 中授予了权限。
编辑:我修复了权限问题,前两个错误仍然存在。 (也就是说,前置问题要求我编辑一个文件,它明确表示不要编辑。尝试在 Glassfish 的 server.policy 中授予此权限没有成功)。
以下是 Glassfish 日志文件中的相关环境信息: https://gist.github.com/1245825
The following error shows up in my Glassfish log when attempting to access my app:
Caused by: org.jruby.exceptions.RaiseException: (NameError) method 'to_yaml' not defined in Object
Looking through the log I see this:
undefined method `bundle_path' for Bundler:Module
I confirmed that warble is definitely putting the Bundler gem in my .war file.
(using ruby 1.9, rails 3.1, glassfish 3.0 and 3.1)
This also appears in the glassfish log:
Policy Provider:Failed Permission Check: context (" myapp/myapp ") , permission (" (java.lang.reflect.ReflectPermission suppressAccessChecks) ") |#]
However I've verified that the permission is granted in server.policy.
EDIT: I fixed the permission problem and the first two errors persist. (That said, the premission problem required me to edit a file it specifically says not to edit. Attempting to grant this permission in server.policy in Glassfish did not work).
Here is the relevant environment info from the Glassfish log file: https://gist.github.com/1245825
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将其托管在 Glassfish 外部的 nginx+passenger 或 apache2+passenger 配置上,并让它代理 Glassfish。如果您不必与任何其他 java 资源/应用程序集成,那么这是一个双赢的解决方案。
You can host it outside Glassfish, on a, nginx+passenger or apache2+passenger configuration, and have it proxying Glassfish. It's a win-win solution, if you don't have to integrate with any other java resource/app.
这会影响某些应用程序服务器,但不会影响其他应用程序服务器。
请参阅此线程以获取更多信息和快速修复。
https://github.com/jruby/warbler/issues/44#issuecomment-2809940
This affects some application servers but not others.
See this thread for further information and a quick fix.
https://github.com/jruby/warbler/issues/44#issuecomment-2809940