Undefined class/module YAML::PrivateType - Error

Hi,

I have uploaded a new version of gem to the server, successfully. If i
install the gem from local, its successfully installed.

But I’m getting following error while installing the same gem from
remote server.

ERROR: While executing gem … (ArgumentError)
undefined class/module YAML::PrivateType

Note:

I have included a method outside of any class/module. Is there any issue
with that?

Thanks,
Priya

I also observed this behavior recently. It seems that it is an
incompatibility between ruby versions (1.8.7 vs. 1.9.2) and rubygems
1.5.0.

I’ve already submitted a ticket in rubygems’s bug tracker:
http://rubyforge.org/tracker/index.php?func=detail&aid=28906&group_id=126&atid=575

blambeau

Have you got any response or do you found any solution to the same?

On Wed, Feb 9, 2011 at 10:51 AM, Bernard L. [email protected]
wrote:

Not yet andit seems that many people are currently observing similar

behavior:http://help.rubygems.org/discussions/problems/483-gems-built-with-rubygems-150-ruby-192-do-not-install-properly-with-150-187

I’ve put ruby-core members in copy, to draw their attention on the problem.
I don’t know how I can make better…

This has already been fixed in RubyGems:
https://github.com/rubygems/rubygems/commit/6a896f356ef325d0357051fa962b6e3a835c04d2

http://help.rubygems.org is not meant to report bugs, is for support
around rubygems.org itself. For that is RubyGems bug tracker:

http://rubyforge.org/projects/rubygems

Not yet and it seems that many people are currently observing similar
behavior:
http://help.rubygems.org/discussions/problems/483-gems-built-with-rubygems-150-ruby-192-do-not-install-properly-with-150-187

I’ve put ruby-core members in copy, to draw their attention on the
problem.
I don’t know how I can make better…

blambeau

On Feb 9, 8:56am, Luis L. [email protected] wrote:

http://rubyforge.org/projects/rubygems


Luis L.
AREA 17

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupry

Has this really been fixed? I see the commit and checked the source
for 1.5.3, so the code fix applies to my setup, but I’m seeing the
error trying to install the (Kristian M.'s) cream gem.

Kristian’s solution (for his own problem) of rm -rf the site_ruby
doesn’t work for me.

“gem install cream”
ERROR: While executing gem … (ArgumentError)
undefined class/module YAML::PrivateType
gem -v
1.5.3
ruby -v (under rvm)
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

On Feb 27, 2011, at 01:49 , Ming wrote:

gem -v
1.5.3
ruby -v (under rvm)
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]

It installs for me (not under rvm):

10004 % rm -rf xxxx
10005 % gem -v
1.5.3
10006 % gem install -i xxxx cream --no-ri --no-rdoc
Fetching: rack-1.2.1.gem (100%)
Fetching: warden-1.0.3.gem (100%)
Fetching: bcrypt-ruby-2.1.4.gem (100%)
Building native extensions. This could take a while…
Fetching: devise-1.1.7.gem (100%)
Fetching: activesupport-3.0.5.gem (100%)
Fetching: require_all-1.2.0.gem (100%)
Fetching: mocha-0.9.12.gem (100%)
Fetching: sugar-high-0.3.5.gem (100%)
Fetching: builder-2.1.2.gem (100%)
Fetching: i18n-0.5.0.gem (100%)
Fetching: activemodel-3.0.5.gem (100%)
Fetching: rack-test-0.5.7.gem (100%)
Fetching: rack-mount-0.6.13.gem (100%)
Fetching: tzinfo-0.3.24.gem (100%)
Fetching: abstract-1.0.0.gem (100%)
Fetching: erubis-2.6.6.gem (100%)
Fetching: actionpack-3.0.5.gem (100%)
Fetching: arel-2.0.9.gem (100%)
Fetching: activerecord-3.0.5.gem (100%)
Fetching: activeresource-3.0.5.gem (100%)
Fetching: mime-types-1.16.gem (100%)
Fetching: polyglot-0.3.1.gem (100%)
Fetching: treetop-1.4.9.gem (100%)
Fetching: mail-2.2.15.gem (100%)
Fetching: actionmailer-3.0.5.gem (100%)
Fetching: rake-0.8.7.gem (100%)
Fetching: thor-0.14.6.gem (100%)
Fetching: railties-3.0.5.gem (100%)
Fetching: bundler-1.0.10.gem (100%)
Fetching: rails-3.0.5.gem (100%)
Fetching: r3_plugin_toolbox-0.4.1.gem (100%)
Fetching: rspec-core-2.5.1.gem (100%)
Fetching: diff-lcs-1.1.2.gem (100%)
Fetching: rspec-expectations-2.5.0.gem (100%)
Fetching: rspec-mocks-2.5.0.gem (100%)
Fetching: rspec-2.5.0.gem (100%)
Fetching: migration_assist-0.1.9.gem (100%)
Fetching: rails3_assist-0.3.7.gem (100%)
Fetching: rails3_artifactor-0.3.2.gem (100%)
Fetching: colorize-0.5.8.gem (100%)
Fetching: thrift-0.5.0.gem (100%)
Building native extensions. This could take a while…
Fetching: thrift_client-0.6.0.gem (100%)
Fetching: scribe-0.2.2.gem (100%)
Fetching: log4r-color-1.2.gem (100%)
Fetching: logging_assist-0.2.1.gem (100%)
Fetching: devise-links-0.2.2.gem (100%)
Fetching: cancan-1.5.1.gem (100%)
Fetching: cancan-rest-links-0.2.2.gem (100%)
Fetching: cancan-permits-0.3.10.gem (100%)
Fetching: cream-0.8.9.2.gem (100%)
Successfully installed rack-1.2.1
Successfully installed warden-1.0.3
Successfully installed bcrypt-ruby-2.1.4
Successfully installed devise-1.1.7
Successfully installed activesupport-3.0.5
Successfully installed require_all-1.2.0
Successfully installed mocha-0.9.12
Successfully installed sugar-high-0.3.5
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.5
Successfully installed rack-test-0.5.7
Successfully installed rack-mount-0.6.13
Successfully installed tzinfo-0.3.24
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.5
Successfully installed arel-2.0.9
Successfully installed activerecord-3.0.5
Successfully installed activeresource-3.0.5
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.1
Successfully installed treetop-1.4.9
Successfully installed mail-2.2.15
Successfully installed actionmailer-3.0.5
Successfully installed rake-0.8.7
Successfully installed thor-0.14.6
Successfully installed railties-3.0.5
Successfully installed bundler-1.0.10
Successfully installed rails-3.0.5
Successfully installed r3_plugin_toolbox-0.4.1
Successfully installed rspec-core-2.5.1
Successfully installed diff-lcs-1.1.2
Successfully installed rspec-expectations-2.5.0
Successfully installed rspec-mocks-2.5.0
Successfully installed rspec-2.5.0
Successfully installed migration_assist-0.1.9
Successfully installed rails3_assist-0.3.7
Successfully installed rails3_artifactor-0.3.2
Successfully installed colorize-0.5.8
Successfully installed thrift-0.5.0
Successfully installed thrift_client-0.6.0
Successfully installed scribe-0.2.2
Successfully installed log4r-color-1.2
Successfully installed logging_assist-0.2.1
Successfully installed devise-links-0.2.2
Successfully installed cancan-1.5.1
Successfully installed cancan-rest-links-0.2.2
Successfully installed cancan-permits-0.3.10
Successfully installed cream-0.8.9.2
50 gems installed
10007 %

On Feb 27, 6:12am, Ryan D. [email protected] wrote:

ERROR: While executing gem … (ArgumentError)
1.5.3
10006 % gem install -i xxxx cream --no-ri --no-rdoc
Fetching: rack-1.2.1.gem (100%)
snipped

Ryan,

Just to confirm, is your successful install above done with ruby
1.9.2? If so, I’ll have to look into rvm as the source of the
problem.

(I installed cream with ruby 1.8.7 under rvm just fine.)

Thanks,
Ming

I finally figured out that removeing site_ruby from the equation fixed
it :slight_smile:

$ sudo rm -rf /Users/kristianconsult/.rvm/rubies/ruby-1.9.2-p136/lib/
ruby/site_ruby

I got a similar issue while installing roles_mongoid on my system
(Ubuntu 10.04 (32b), using rvm, ruby: 1.9.2-p180, rubygems 1.6.1). So
the exception is the same, in fact I tried to install it by cloning the
gem repo and got the same results:

roles_mongoid$ rake install --trace
(in /home/marcelo/workspace/roles_mongoid)
** Invoke install (first_time)
** Invoke build (first_time)
** Execute build
Successfully built RubyGem
Name: roles_mongoid
Version: 0.4.5
File: roles_mongoid-0.4.5.gem
** Execute install
Executing “ruby -S gem install ./pkg/roles_mongoid-0.4.5.gem”:
ruby -S gem install ./pkg/roles_mongoid-0.4.5.gem
ERROR: While executing gem … (ArgumentError)
undefined class/module YAML::PrivateType
rake aborted!
Command failed with status (1): [ruby -S gem install
./pkg/roles_mongoid-0…]
/home/marcelo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:995:in
block in sh' /home/marcelo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:incall’
/home/marcelo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:in
`sh’

Does anyone faced a similar problem or have any idea about this issue ?

BTW: By using other rubygems version (such us 1.5.x) I’ve got the same
issue. But, If I use Rubygems 1.3.7 I’ve got a different issue:

$ rake install
(in /home/marcelo/workspace/roles_mongoid)
WARNING: no rubyforge_project specified
Successfully built RubyGem
Name: roles_mongoid
Version: 0.4.5
File: roles_mongoid-0.4.5.gem
Executing “ruby -S gem install ./pkg/roles_mongoid-0.4.5.gem”:
ruby -S gem install ./pkg/roles_mongoid-0.4.5.gem
ERROR: While executing gem … (Gem::Exception)
ruby_code case not handled: Syck::PrivateType

Any help would be highly appreciated :slight_smile:

On Mar 5, 2011, at 14:12 , Marcelo Giorgi wrote:

Successfully built RubyGem
./pkg/roles_mongoid-0…]
/home/marcelo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:995:in
block in sh' /home/marcelo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:incall’
/home/marcelo/.rvm/gems/ruby-1.9.2-p180/gems/rake-0.8.7/lib/rake.rb:1010:in
`sh’

Does anyone faced a similar problem or have any idea about this issue ?

Huh… I don’t get that error at all! I get something much much better:

10020 % GEM_HOME=xxx GEM_PATH=xxx rake19 install -t
(in /Users/ryan/roles_mongoid-0.4.5)
** Invoke install (first_time)
** Invoke build (first_time)
** Execute build
Successfully built RubyGem
Name: roles_mongoid
Version: 0.4.5
File: roles_mongoid-0.4.5.gem
** Execute install
Executing “ruby -S gem install ./pkg/roles_mongoid-0.4.5.gem”:
ruby -S gem install ./pkg/roles_mongoid-0.4.5.gem
ERROR: While executing gem … (Gem::DependencyError)
Unable to resolve dependencies: rails3_assist requires sugar-high
(~> 0.3.0); rails3_artifactor requires sugar-high (~> 0.3.0);
roles_mongoid requires sugar-high (>= 0.3.5), sugar-high (~> 0.3.5);
rails_assist requires sugar-high (~> 0.4.0), sugar-high (~> 0.4.0);
logging_assist requires sugar-high (~> 0.4.0); rails_artifactor requires
sugar-high (~> 0.4.0); roles_generic requires sugar-high (~> 0.4.0),
sugar-high (~> 0.4.0)

Which is about seven levels of awesome in my book!

In your case… can you do the following for me?

% gem spec pkg/roles_mongoid-0.4.5.gem | grep PrivateType

and if that doesn’t match at all try this:

% rm -rf ~/.gem/specs/*

But really at this point I’m just guessing.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs