Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #10001 (new defect)

Opened 11 months ago

Last modified 9 months ago

Rails breaks when soap4r gem is upgraded to 1.5.8

Reported by: minaguib Assigned to: core
Priority: high Milestone: 1.2.7
Component: ActiveSupport Version: edge
Severity: major Keywords: soap4r fail failure XSD NS KNOWN_TAG
Cc: thewoolleyman@gmail.com

Description

A brand-new rails project (tested with 1.2.4 and 1.2.5) will fail when starting the server:

$ ./script/server 
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
/usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:477:in `const_missing': uninitialized constant XSD::NS::KNOWN_TAG (NameError)
        from /usr/lib64/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/ns.rb:18
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from /usr/lib64/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in `require'
        from /usr/lib64/ruby/gems/1.8/gems/soap4r-1.5.8/lib/soap/generator.rb:10
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
         ... 73 levels...
        from /usr/lib64/ruby/gems/1.8/gems/rails-1.2.5/lib/commands/server.rb:39
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
        from /usr/lib64/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'

This has been well documented in the soap4r trac ( http://dev.ctor.org/soap4r/ticket/433 ) and it seems that the resolution is that it needs to be fixed in rails.

Change History

11/01/07 15:05:57 changed by yyyc514

It seems some type of weird conflict between Ruby's build in soap and soapr4r?

I add the following to the top of my environments and everything starts working again:

require 'rubygems'
gem 'soap4r' rescue nil

The rescue nil insures that the app works both on boxes where soap4r is installed and boxes where it's not... I have no idea what this code might do if you have 1.5.7 instead of 1.5.8... I've just found this fixes my immediate problem of Rails 2.0 apps and having the 1.5.8 gem installed.

I would still agree the problem seems to be with Rails though... installing a gem shouldn't break an app.

11/01/07 15:06:25 changed by yyyc514

Not suggesting that's the fix or anything... just sharing.

11/08/07 08:57:45 changed by thewoolleyman

  • cc set to thewoolleyman@gmail.com.

12/12/07 07:49:29 changed by sbeckeriv

Not the fix but:

I created a gems dir in the vendor folder and installed soap4r there. sudo gem install --install-dir ~/rails_dir/vendor/gems soap4r

Then in server.rb (railties/command/server.rb) I set the ENVGEM_PATH? to ENVGEM_PATH? = "#{File.dirname(FILE)}/../../../../gems" Then I can gem "soap4r" all I want.

Side affect is console stops working. You have to also set the GEM_PATH in the environment.rb file

I have not tested with many servers.

12/12/07 17:04:15 changed by sbeckeriv

I forgot to add after you require rubygems and set the GEM_PATH you need to call Gem.clear_paths. This way you only need to do this in the environment.rb file as well.