superclass mismatch for class HTTP on mac os X
I'm having some troubles installing my Ruby on Rails environment on my Mac, I'm trying with this versions:
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.7.1]
gem 1.8.6
Snow Leopard 10.6.8
I think that XCode by default installs some ruby libraries that are in conflict with some of my gems. To install ruby I have used "rvm install 1.8.7"
This is the error's stack trace:
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7开发者_开发知识库-p352/lib/ruby/1.8/net/http.rb:278
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/net/https.rb:101
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.3) lib/active_support/dependencies.rb:225:in `load_dependency'
activesupport (3.0.3) lib/active_support/dependencies.rb:239:in `require'
activesupport (3.0.3) lib/active_support/dependencies.rb:454:in `load'
activesupport (3.0.3) lib/active_support/dependencies.rb:454:in `load_file'
activesupport (3.0.3) lib/active_support/dependencies.rb:596:in `new_constants_in'
activesupport (3.0.3) lib/active_support/dependencies.rb:453:in `load_file'
activesupport (3.0.3) lib/active_support/dependencies.rb:340:in `require_or_load'
activesupport (3.0.3) lib/active_support/dependencies.rb:491:in `load_missing_constant'
activesupport (3.0.3) lib/active_support/dependencies.rb:183:in `const_missing'
activesupport (3.0.3) lib/active_support/dependencies.rb:181:in `each'
activesupport (3.0.3) lib/active_support/dependencies.rb:181:in `const_missing'
activesupport (3.0.3) lib/active_support/inflector/methods.rb:113:in `constantize'
activesupport (3.0.3) lib/active_support/inflector/methods.rb:112:in `each'
activesupport (3.0.3) lib/active_support/inflector/methods.rb:112:in `constantize'
activesupport (3.0.3) lib/active_support/dependencies.rb:528
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `call'
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `default'
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `[]'
activesupport (3.0.3) lib/active_support/dependencies.rb:538:in `get'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:58:in `controller_reference'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:44:in `controller'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:23:in `call'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `call'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `recognize'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each'
rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize'
rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call'
actionpack (3.0.3) lib/action_dispatch/routing/route_set.rb:492:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.3) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/cookies.rb:295:in `call'
activerecord (3.0.3) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.3) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.3) lib/active_record/connection_adapters/abstract/connection_pool.rb:353:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.3) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.3) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.3) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/show_exceptions.rb:46:in `call'
railties (3.0.3) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.3) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
rack (1.2.3) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.3) lib/rack/lock.rb:11:in `call'
actionpack (3.0.3) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.3) lib/rails/application.rb:168:in `call'
railties (3.0.3) lib/rails/application.rb:77:in `send'
railties (3.0.3) lib/rails/application.rb:77:in `method_missing'
railties (3.0.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.2.3) lib/rack/content_length.rb:13:in `call'
rack (1.2.3) lib/rack/handler/webrick.rb:52:in `service'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:95:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `each'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:92:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:23:in `start'
/Users/raimonbosch//.rvm/rubies/ruby-1.8.7-p352/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.2.3) lib/rack/handler/webrick.rb:13:in `run'
rack (1.2.3) lib/rack/server.rb:217:in `start'
railties (3.0.3) lib/rails/commands/server.rb:65:in `start'
railties (3.0.3) lib/rails/commands.rb:30
railties (3.0.3) lib/rails/commands.rb:27:in `tap'
railties (3.0.3) lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Thanks in advance,
Raimon Bosch.
In the end we found another class in the repository with the same name:
cd $HOME/.rvm/gems
find . -name *.rb | xargs grep 'class HTTP'
Then we see an HTTP class on net.ssh-2.1.4
./ruby-1.8.7-p352/gems/net-ssh-2.1.4/lib/net/ssh/proxy/http.rb: class HTTP
To solve the problem we forced the require 'net/http' and require 'net/https' at the beginning of the application. If the aplication requires the default gems is requiring first the HTTP class of net-ssh-2.1.4 and then we are not able to use Net:HTTP.
精彩评论