New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rails 3.1.1 fails with Psych 1.2.2 in Ruby 1.9.3p0 #3488
Comments
Do you have psych 1.2.2 installed? |
Ah, you do: Uninstalling that will fix the issue for now. This is due to a pathological web of dependencies between bundler, psych in ruby stdlib, and the psych rubygem. Psych 1.2.3 will include a hack to work around the double-loading issue that bundler exposes. |
Thanks, uninstalling Psych 1.2.2 fixed the problem! |
+1 for adding a line to Rails to warn about the bad psych and how to solve it. Thanks for considering it. |
I'm seeing a different, but related bug. Posting here because this is the only page on the interwebs with the same error message. In case this helps anyone else, when running ruby-1.9.3-p194 (from RVM), rspec spec (or any bundler command) fails with the same "superclass mismatch for class Mark". I don't have the psych (or syck) gems installed. Running ruby-1.9.3-p0 or 1.93-p125, (also from RVM) makes the problem go away. |
+1 to arohner, I get the same error |
I added the |
+1 I get this with p194. Going to try a different ruby to see if this still happens |
I downloaded ruby version 1.9.2, compiled, installed and it worked.. I then went back to ruby 1.9.3p194, and it also worked.. not sure what the hell... but it works. Maybe this can help someone ? |
+1 to @adambird solution |
+1 |
i was having psych 1.3.4. adding it to Gemfile solved for me. |
Here's the underlying bug in bundler that causes this problem: rubygems/bundler#2068 |
The problem still occurs with newer versions of everything (see below), and the only real workaround is still to uninstall the Psych gem completely. 👊 $ ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]
$ gem --version
1.8.24
$ bundle --version
Bundler version 1.3.0.pre.3
$ rails --version
Rails 3.2.9
$ gem list psych
*** LOCAL GEMS ***
psych (1.3.4, 1.2.1)
$ rails new foobar
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
create config/initializers/backtrace_silencers.rb
create config/initializers/inflections.rb
create config/initializers/mime_types.rb
create config/initializers/secret_token.rb
create config/initializers/session_store.rb
create config/initializers/wrap_parameters.rb
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create lib/assets
create lib/assets/.gitkeep
create log
create log/.gitkeep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create script
create script/rails
create test/fixtures
create test/fixtures/.gitkeep
create test/functional
create test/functional/.gitkeep
create test/integration
create test/integration/.gitkeep
create test/unit
create test/unit/.gitkeep
create test/performance/browsing_test.rb
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.9)
Using builder (3.0.4)
Using activemodel (3.2.9)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.2.2)
Using actionpack (3.2.9)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.9)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.9)
Using activeresource (3.2.9)
Using bundler (1.3.0.pre.3)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.16.0)
Using railties (3.2.9)
Using coffee-rails (3.2.2)
Using jquery-rails (2.1.4)
Using rails (3.2.9)
Using sass (3.2.4)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.3.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$ cd foobar
$ bundle exec rails runner 'puts :ok'
/usr/lib/ruby/1.9.1/x86_64-linux/psych.so: warning: already initialized constant ANY
/usr/lib/ruby/1.9.1/x86_64-linux/psych.so: warning: already initialized constant UTF8
/usr/lib/ruby/1.9.1/x86_64-linux/psych.so: warning: already initialized constant UTF16LE
/usr/lib/ruby/1.9.1/x86_64-linux/psych.so: warning: already initialized constant UTF16BE
/usr/lib/ruby/1.9.1/psych/nodes/stream.rb:12: warning: already initialized constant ANY
/usr/lib/ruby/1.9.1/psych/nodes/stream.rb:15: warning: already initialized constant UTF8
/usr/lib/ruby/1.9.1/psych/nodes/stream.rb:18: warning: already initialized constant UTF16LE
/usr/lib/ruby/1.9.1/psych/nodes/stream.rb:21: warning: already initialized constant UTF16BE
/usr/lib/ruby/1.9.1/psych/nodes/sequence.rb:42: warning: already initialized constant ANY
/usr/lib/ruby/1.9.1/psych/nodes/sequence.rb:45: warning: already initialized constant BLOCK
/usr/lib/ruby/1.9.1/psych/nodes/sequence.rb:48: warning: already initialized constant FLOW
/usr/lib/ruby/1.9.1/psych/nodes/scalar.rb:9: warning: already initialized constant ANY
/usr/lib/ruby/1.9.1/psych/nodes/scalar.rb:12: warning: already initialized constant PLAIN
/usr/lib/ruby/1.9.1/psych/nodes/scalar.rb:15: warning: already initialized constant SINGLE_QUOTED
/usr/lib/ruby/1.9.1/psych/nodes/scalar.rb:18: warning: already initialized constant DOUBLE_QUOTED
/usr/lib/ruby/1.9.1/psych/nodes/scalar.rb:21: warning: already initialized constant LITERAL
/usr/lib/ruby/1.9.1/psych/nodes/scalar.rb:24: warning: already initialized constant FOLDED
/usr/lib/ruby/1.9.1/psych/nodes/mapping.rb:16: warning: already initialized constant ANY
/usr/lib/ruby/1.9.1/psych/nodes/mapping.rb:19: warning: already initialized constant BLOCK
/usr/lib/ruby/1.9.1/psych/nodes/mapping.rb:22: warning: already initialized constant FLOW
/usr/lib/ruby/1.9.1/psych/visitors/visitor.rb:10: warning: already initialized constant DISPATCH
/usr/lib/ruby/1.9.1/psych/scalar_scanner.rb:8: warning: already initialized constant TIME
/usr/lib/ruby/1.9.1/psych/scalar_scanner.rb:11: warning: already initialized constant FLOAT
/usr/lib/ruby/1.9.1/psych/handler.rb:26: warning: already initialized constant OPTIONS
/usr/lib/ruby/1.9.1/psych/parser.rb:33:in `<class:Parser>': superclass mismatch for class Mark (TypeError)
from /usr/lib/ruby/1.9.1/psych/parser.rb:32:in `<module:Psych>'
from /usr/lib/ruby/1.9.1/psych/parser.rb:1:in `<top (required)>'
from /usr/lib/ruby/1.9.1/psych.rb:7:in `require'
from /usr/lib/ruby/1.9.1/psych.rb:7:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/activesupport-3.2.9/lib/active_support/ordered_hash.rb:2:in `require'
from /home/skurapati/app/rubygems/gems/activesupport-3.2.9/lib/active_support/ordered_hash.rb:2:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/activesupport-3.2.9/lib/active_support/ordered_options.rb:1:in `require'
from /home/skurapati/app/rubygems/gems/activesupport-3.2.9/lib/active_support/ordered_options.rb:1:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/configuration.rb:2:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/configuration.rb:2:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/railtie.rb:2:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/railtie.rb:2:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/engine.rb:1:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/engine.rb:1:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/plugin.rb:1:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/plugin.rb:1:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/application.rb:3:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/application.rb:3:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails.rb:10:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails.rb:10:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/all.rb:1:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/all.rb:1:in `<top (required)>'
from /tmp/foobar/config/application.rb:3:in `require'
from /tmp/foobar/config/application.rb:3:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/commands/runner.rb:43:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/commands/runner.rb:43:in `<top (required)>'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/commands.rb:64:in `require'
from /home/skurapati/app/rubygems/gems/railties-3.2.9/lib/rails/commands.rb:64:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
exit 1
$ gem uninstall psych
Select gem to uninstall:
1. psych-1.2.1
2. psych-1.3.4
3. All versions
> 3
Successfully uninstalled psych-1.2.1
Successfully uninstalled psych-1.3.4
$ bundle exec rails runner 'puts :ok'
ok |
The bundler developers suggest adding psych to the Gemfile to fix the issue. And it works! (see below) 😺 $ echo 'gem "psych"' >> Gemfile
$ bundle
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.0.3)
Using i18n (0.6.1)
Using multi_json (1.5.0)
Using activesupport (3.2.9)
Using builder (3.0.4)
Using activemodel (3.2.9)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.2.2)
Using actionpack (3.2.9)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.9)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.9)
Using activeresource (3.2.9)
Using bundler (1.3.0.pre.3)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.16.0)
Using railties (3.2.9)
Using coffee-rails (3.2.2)
Using jquery-rails (2.1.4)
Installing psych (1.3.4)
Using rails (3.2.9)
Using sass (3.2.4)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.3.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
$ bundle exec rails runner 'puts :ok'
ok |
Details below. Thank you.
The text was updated successfully, but these errors were encountered: