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

···

--
Posted via http://www.ruby-forum.com/.

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

···

On Wed, Feb 9, 2011 at 8:09 AM, Priya D. <dharsininitt@gmail.com> wrote:

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

--
Posted via http://www.ruby-forum.com/\.

--
PhD Student, Computer Science Department, EPL/INGI, UCLouvain, Belgium
Mail: blambeau@gmail.com
Mobile: +32 477 24 58 61
Blog: http://revision-zero.org/
Code: blambeau (Bernard Lambeau) · GitHub
Follow: http://twitter.com/blambeau/

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:in
`call'
/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:

···

--
Posted via http://www.ruby-forum.com/.

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

···

--
Posted via http://www.ruby-forum.com/.

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.

···

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

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:in
`call'
/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 ?

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 Wed, Feb 9, 2011 at 10:36 AM, Priya D. <dharsininitt@gmail.com> wrote:

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

--
Posted via http://www.ruby-forum.com/\.

--
PhD Student, Computer Science Department, EPL/INGI, UCLouvain, Belgium
Mail: blambeau@gmail.com
Mobile: +32 477 24 58 61
Blog: http://revision-zero.org/
Code: blambeau (Bernard Lambeau) · GitHub
Follow: http://twitter.com/blambeau/

This has already been fixed in RubyGems:

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

···

On Wed, Feb 9, 2011 at 10:51 AM, Bernard Lambeau <blambeau@gmail.com> wrote:

Not yet and it seems that many people are currently observing similar
behavior: Gems built with (rubygems 1.5.0 / ruby 1.9.2) do not install properly with (1.5.0 / 1.8.7) / Problems / Discussion Area - RubyGems.org Support
I've put ruby-core members in copy, to draw their attention on the problem.
I don't know how I can make better...

--
Luis Lavena
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-Exupéry

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

···

On Feb 9, 2:56 pm, Luis Lavena <luislav...@gmail.com> wrote:

On Wed, Feb 9, 2011 at 10:51 AM, Bernard Lambeau <blamb...@gmail.com> wrote:
> Not yet and it seems that many people are currently observing similar
> behavior: http://help.rubygems.org/discussions/problems/483-gems-built-with-rub\.\.\.
> 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/6a896f356ef325d0357051fa9\.\.\.

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

http://rubyforge.org/projects/rubygems

--
Luis Lavena
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-Exupéry

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 Mandrup'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 9, 8:56 am, Luis Lavena <luislav...@gmail.com> wrote:

On Wed, Feb 9, 2011 at 10:51 AM, Bernard Lambeau <blamb...@gmail.com> wrote:
> Not yet and it seems that many people are currently observing similar
> behavior: http://help.rubygems.org/discussions/problems/483-gems-built-with-rub\.\.\.
> 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/6a896f356ef325d0357051fa9\.\.\.

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

http://rubyforge.org/projects/rubygems

--
Luis Lavena
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-Exupéry

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, 2011, at 01:49 , Ming wrote:

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 Mandrup'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]

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

···

On Feb 27, 6:12 am, Ryan Davis <ryand-r...@zenspider.com> wrote:

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

> 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 Mandrup'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]

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%)
snipped