Search code examples
ruby-on-railsglassfishjrubybundlerwarbler

Deploying JRuby/Rails to Glassfish: undefined method `bundle_path' for Bundler:Module


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


Solution

  • 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