Please a help to investigate about a strange problem

I have two rails applications, I user jruby-1.6.2 and rails 3.0.7.
When I run bundle update for the first application I have no problems.
When I run bundle update for the second application it runs
indefinitely.
The Gemfile of the first application is:

source ‘http://rubygems.org

gem ‘rails’
gem ‘compass’
gem ‘annotate’
gem ‘normalize_attributes’
gem ‘haml-rails’
gem ‘jquery-rails’
gem ‘devise_ldap_authenticatable’
gem ‘meta_where’
gem ‘meta_search’
gem ‘simple_form’
gem ‘fastercsv’
gem ‘inherited_resources’
gem ‘inherited_resources_views’
gem ‘rails_config’
gem ‘simple-navigation’
gem ‘mongrel’
gem ‘kaminari’

Bundle edge Rails instead:

gem ‘rails’, :git => ‘git://github.com/rails/rails.git’

platforms :ruby do
gem ‘sqlite3’
gem ‘pg’

Deploy with Capistrano

gem ‘capistrano’
end

platforms :jruby do
gem ‘activerecord-jdbc-adapter’

As rails --database switch does not support derby, hsqldb, h2 nor

mssql

as valid values, if you are not using SQLite, comment out the SQLite

gem

below and uncomment the gem declaration for the adapter you are

using.

If you are using oracle, db2, sybase, informix or prefer to use the

plain

JDBC adapter, comment out all the adapter gems below.

SQLite JDBC adapter

gem ‘jdbc-sqlite3’, :require => false

gem ‘jdbc-sqlite3’, :require => false

Postgres JDBC adapter

#gem ‘activerecord-jdbcpostgresql-adapter’
gem ‘jdbc-postgres’

gem ‘jruby-openssl’
gem ‘warbler’

end

Use unicorn as the web server

gem ‘unicorn’

Deploy with Capistrano

gem ‘capistrano’

To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby

1.9.2+)
#platforms :ruby_18 do

gem ‘ruby-debug’

gem ‘mongrel’, ‘1.1.5’

gem ‘thin’

#end

#platforms :ruby_19 do
#gem ‘ruby-debug19’, :require => ‘ruby-debug’
#gem ‘mongrel’, ‘1.2.0.pre2’
#end

Bundle the extra gems:

gem ‘bj’

gem ‘nokogiri’

gem ‘sqlite3-ruby’, :require => ‘sqlite3’

gem ‘aws-s3’, :require => ‘aws/s3’

Bundle gems for the local environment. Make sure to

put test-only gems in this group so their generators

and rake tasks are available in development mode:

group :development, :test do
gem ‘rspec-rails’
gem ‘cucumber-rails’
gem ‘capybara’
gem ‘launchy’
gem ‘autotest’

gem ‘autotest-notification’
gem ‘database_cleaner’
gem ‘spork’, ‘~> 0.9.0.rc’
gem ‘machinist’, ‘>= 2.0.0.beta1’
gem ‘faker’
end

group :development do
gem ‘hpricot’
gem ‘ruby_parser’
end

The Gemfile for the second application is:

source ‘http://rubygems.org

gem ‘rails’

Bundle edge Rails instead:

gem ‘rails’, :git => ‘git://github.com/rails/rails.git’

platforms :jruby do
gem ‘activerecord-jdbc-adapter’

As rails --database switch does not support derby, hsqldb, h2 nor

mssql

as valid values, if you are not using SQLite, comment out the SQLite

gem

below and uncomment the gem declaration for the adapter you are

using.

If you are using oracle, db2, sybase, informix or prefer to use the

plain

JDBC adapter, comment out all the adapter gems below.

SQLite JDBC adapter

gem ‘jdbc-sqlite3’, :require => false

Postgres JDBC adapter

#gem ‘activerecord-jdbcpostgresql-adapter’
gem ‘jdbc-postgres’
gem ‘jruby-openssl’
gem ‘warbler’

end

#if defined?(JRUBY_VERSION)

gem ‘activerecord-jdbc-adapter’

gem ‘activerecord-jdbcpostgresql-adapter’

gem ‘jdbc-postgres’

#else

gem ‘postgres-ruby’, :require => ‘postgres’

#end

Use unicorn as the web server

gem ‘unicorn’

Deploy with Capistrano

gem ‘capistrano’

To use debugger

gem ‘ruby-debug’

Bundle the extra gems:

gem ‘bj’

gem ‘nokogiri’

gem ‘sqlite3-ruby’, :require => ‘sqlite3’

gem ‘aws-s3’, :require => ‘aws/s3’

Bundle gems for the local environment. Make sure to

put test-only gems in this group so their generators

and rake tasks are available in development mode:

group :development, :test do

gem ‘webrat’

end

gem “will_paginate”, “~> 3.0.pre2”
gem ‘foreigner’
gem ‘jquery-rails’
gem ‘simple_form’
gem ‘devise_ldap_authenticatable’
gem ‘normalize_attributes’
gem ‘annotate’
gem ‘mongrel’

If I copy the Gemfile of the first application in the second one
bundle update works.
I should think that the problem is the Gemfile but it sounds strange
to me and I don’t see problem in the Gemfile of the second
application.
What do you think about?

does MRI fail similarly?
you could use tracer library to see where it’s hanging (and/or strace et
al)
what platform?

On 27 May 2011 20:47, Roger P. [email protected] wrote:

does MRI fail similarly?

I don’t have MRI.

you could use tracer library to see where it’s hanging (and/or strace et
al)
what platform?

Sorry I don’t understand what I have to do.
The platform is jruby-1.6.2.

On 27 May 2011 20:54, Mauro [email protected] wrote:

The platform is jruby-1.6.2.

If I run jruby -d -S bundle update I see:

Exception LoadError' at org/jruby/RubyKernel.java:1038 - no such file to load -- psych Exception Gem::LoadError’ at
/home/user/jruby/lib/ruby/site_ruby/1.8/rubygems.rb:861 - RubyGem
version error: sources(0.0.1 not > 0.0.1)

Fetching source index for http://rubygems.org/
Exception EOFError' at org/jruby/RubyIO.java:2641 - End of file reached Exception EOFError’ at org/jruby/RubyIO.java:2641 - End of file reached

On 27 May 2011 21:01, Mauro [email protected] wrote:

Sorry I don’t understand what I have to do.

Fetching source index for http://rubygems.org/
Exception EOFError' at org/jruby/RubyIO.java:2641 - End of file reached Exception EOFError’ at org/jruby/RubyIO.java:2641 - End of file reached

I also see that it’s the same messages if I run jruby -d -S bundle
update for the second application but after about one minute the gems
are updated, while bundle update for the first application updates the
gem after about 15 minutes.
I don’t know why :frowning:

On 27 May 2011 21:07, Mauro [email protected] wrote:

I also see that it’s the same messages if I run jruby -d -S bundle
update for the second application but after about one minute the gems
are updated, while bundle update for the first application updates the
gem after about 15 minutes.
I don’t know why :frowning:

If I copy the Gemfile of the second app in the first app then bundle
update runs faster.

On 28 May 2011 14:33, Rhett S. [email protected] wrote:

The only solution I know of for this problem is try to break the recursion
that’s taking forever. You can do this by paging through the debug output and
looking for a gem that has many different versions being tried and then locking it
to specific version in your Gemfile. The one I’ve had success with Rails 3 apps is
“builder”:

group :resolver_hacks do
gem ‘builder’, ‘~> 2.1.2’
end

Thanks for your answer, I redo my Gemfile and delete Gemfile.lock.

Hi,

On May 27, 2011, at 4:12 PM, Mauro wrote:

On 27 May 2011 21:07, Mauro [email protected] wrote:

I also see that it’s the same messages if I run jruby -d -S bundle
update for the second application but after about one minute the gems
are updated, while bundle update for the first application updates the
gem after about 15 minutes.
I don’t know why :frowning:

If I copy the Gemfile of the second app in the first app then bundle
update runs faster.

This sounds like a bundler problem. I have had a similar issue. My
understanding of the problem is this: The process of finding a set of
gems which meet your Gemfile criteria is not guaranteed to run in any
particular amount of time; it can be a deeply recursive process. If you
have many gems, or depend on gems with many available versions, it can
take a very long time for bundler to sort out any conflicts. You can
observe the gem resolver in action by setting the environment variable
DEBUG_RESOLVER before running bundler:

$ DEBUG_RESOLVER=true bundle update > resolver.log

This will produce copious output, so I recommend redirecting it to a
file for examination.

Bundler can speed this up some if you already have a Gemfile.lock
because it has a set to start from. This is my guess for why moving the
Gemfile between projects speeds things up.

The only solution I know of for this problem is try to break the
recursion that’s taking forever. You can do this by paging through the
debug output and looking for a gem that has many different versions
being tried and then locking it to specific version in your Gemfile. The
one I’ve had success with Rails 3 apps is “builder”:

group :resolver_hacks do
gem ‘builder’, ‘~> 2.1.2’
end

Rhett