How can I remove bundler from my rails 3 app?

I’m using jruby 1.6.0 and trying to deploy my rails 3 app to Tomcat.
When the app loads I get the error “stack level too deep” as bundler
is trying to resolve dependencies. I’ve spent hours searching forums
in an effort to resolve this but there doesn’t seem to be a resolution
to this problem. Can someone explain how I can remove bundler from my
application so as I can get this deployed? It seems that bundler is
tightly integrated with Rails 3. Hopefully Rails is not dependent on
it since it makes it impossible to deploy to either Tomcat or the
Glassfish server.

On Apr 20, 5:55am, MJW2529 [email protected] wrote:

I’m using jruby 1.6.0 and trying to deploy my rails 3 app to Tomcat.
When the app loads I get the error “stack level too deep” as bundler
is trying to resolve dependencies. I’ve spent hours searching forums
in an effort to resolve this but there doesn’t seem to be a resolution
to this problem. Can someone explain how I can remove bundler from my
application so as I can get this deployed? It seems that bundler is
tightly integrated with Rails 3. Hopefully Rails is not dependent on
it since it makes it impossible to deploy to either Tomcat or the
Glassfish server.

Not sure about untangling rails 3 from bundler but I did find
http://techblog.amphora-research.com/2011/03/tomcat-6-stack-level-too-deep-error-on-windows/#
which claims that this is a tomcat problem

Fred

No, Bundler is not really coupled. Just delete de Gemfile and you’re
done.

Having said that, I’d try to reach the bundler guys with a minimal app
the shows your issue.

I’ve tried running this on Glassfish and got the exact same error, so
it must be in the bundler code. I’ve removed bundler from the app and
added the requires to the environment.rb file and did get this
running. However, it’s obviously not an ideal solution.

On Apr 20, 12:13am, Frederick C. [email protected]

On Wed, Apr 20, 2011 at 8:07 PM, MJW2529 [email protected] wrote:

I’ve tried running this on Glassfish and got the exact same error, so
it must be in the bundler code. I’ve removed bundler from the app and
added the requires to the environment.rb file and did get this
running. However, it’s obviously not an ideal solution.

boot.rb starts this way:

require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)

if File.exist?(gemfile)
  ENV['BUNDLE_GEMFILE'] = gemfile
  require 'bundler'
  Bundler.setup
end

That’s done on purpose, so that it is trivial to out-opt. Removing the
Gemfile should be enough, if there’s no Gemfile, no bundler code
should be called (and if it does, it is a bug).

Thanks Xaviar. This is very useful since I want to run bundler when I
push the code over so as I get the gems installed, but then exclude it
in the war file to run under Tomcat.