# Gems error concerning yaml

**URL:** <https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925>\
**Category:** Ruby\
**Created:** [June 9, 2008, 8:02am UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925 "2008-06-09T08:02:11Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 9, 2008, 8:02am UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/1 "2008-06-09T08:02:11Z")

</div>

I’m trying to install rails using gems. It chokes on yaml.

# gem18 install yaml --include-dependencies

INFO: `gem install -y` is now default and will be removed  
INFO: use --ignore-dependencies to install only the gems you list  
Bulk updating Gem source index for: [http://gems.rubyforge.org/](http://gems.rubyforge.org/)  
ERROR: could not find yaml locally or in a repository

advice?  
Michael L.

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 9, 2008, 8:16am UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/2 "2008-06-09T08:16:17Z")

</div>

On Jun 9, 1:52 am, Michael L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Michael L.  
> eh, AFAIK yaml comes with the base ruby install.

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 9, 2008, 9:05am UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/3 "2008-06-09T09:05:40Z")

</div>

Then why would gems break on a yaml install when I tried to install  
rails?  
The text I posted was my attempt to install yaml directly, in the hopes  
of getting useful error messages. Originally, I just did this.

# gem18 install yaml --include-dependencies

INFO: `gem install -y` is now default and will be removed  
INFO: use --ignore-dependencies to install only the gems you list  
Bulk updating Gem source index for: [http://gems.rubyforge.org/](http://gems.rubyforge.org/)  
ERROR: could not find yaml locally or in a repository

It seems to me, if yaml is part of the base install, then gems should  
not  
try to install it. If it isn’t, then it should install successfully.  
Either  
way, it seems like  
a little problem.

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 9, 2008, 10:01am UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/4 "2008-06-09T10:01:36Z")

</div>

On Monday 09 June 2008 02:03:39 Michael L. wrote:

> Then why would gems break on a yaml install when I tried to install rails?

I don’t know. Why would you try to install yaml directly? I don’t see it  
as a  
requirement for Rails anymore – try “gem install rails” and see what  
happens.

> # gem18 install yaml --include-dependencies

…

> ERROR: could not find yaml locally or in a repository

That pretty clearly tells you that “yaml” does not exist as a library,  
and  
that you should look for it elsewhere.

> It seems to me, if yaml is part of the base install, then gems should not  
> try to install it.

There isn’t any way, right now, for a gem to be part of the base  
install.  
There isn’t even a one-to-one mapping between gems (as in gem install  
foo)  
and libraries (as in require ‘foo’).

I’m not convinced that’s an ideal architecture, but that’s how it is.

So are you suggesting that there should be a list of keywords for which  
Rubygems will say “I think you mean something that’s now part of core”?

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 10, 2008, 8:17pm UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/5 "2008-06-10T20:17:20Z")

</div>

On Jun 9, 2008, at 09:57 AM, Michael L. wrote:

> dependencies. It was yaml.  
> There is no yaml gem, so it couldn’t fail to be installed as a  
> dependency, as no gem lists it as a dependency.

Can you paste the exact text of this failure? Maybe the actual error  
message you got can be reworded in order to prevent confusion.

> I ended up using netbsd’s pkgsrc to install rails. It’s working now.  
> But I  
> don’t understand why gems would think I needed to download yaml, and  
> then  
> choke when it couldn’t find it. Other package managers I have used  
> don’t do  
> this.

Since there’s no yaml gem, of course RubyGems will “choke” it.

Other package managers “choke” on things that don’t exist:

MacPorts:

$ port install nosuchport  
Error: Port nosuchport not found

FreeBSD’s pkg\_add:

$ pkg\_add -r nosuchpackage  
Error: FTP Unable to get  
ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/Latest/nosuchpackage.tbz  
: File unavailable (e.g., file not found, no access)  
pkg\_add: unable to fetch  
‘ftp://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-6.2-release/Latest/nosuchpackage.tbz’  
by URL

FreeBSD’s portupgrade:

$ portupgrade -N nosuchport  
\*\* No such installed package or port: nosuchport

RubyGems:

$ gem install nosuchgem  
ERROR: could not find gem nosuchgem locally or in a repository

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 9, 2008, 7:00pm UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/6 "2008-06-09T19:00:19Z")

</div>

On Mon, Jun 9, 2008 at 12:58 AM, David M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> So are you suggesting that there should be a list of keywords for which  
> Rubygems will say “I think you mean something that’s now part of core”?

no no. but when I did a gems install ruby, it choked on one of the  
dependencies. It was yaml.  
I ended up using netbsd’s pkgsrc to install rails. It’s working now. But  
I  
don’t understand why gems would think I needed to download yaml, and  
then  
choke when it couldn’t find it. Other package managers I have used don’t  
do  
this. Anyway, I was very excited to see rails working right away with  
hardly  
any effort on my part, now I’m going to get to work on my project  
to learn Ruby (building a blog engine).

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 11, 2008, 8:43pm UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/7 "2008-06-11T20:43:14Z")

</div>

On Jun 10, 2008, at 23:13 PM, Michael T. Richter wrote:

> whole point of exception-handling – exception raised at the point  
> of detection, exception rescued at the point of knowing what went  
> wrong, error message produced that explains situation – but this is  
> neither here nor there.)

I would like to make RubyGems super awesome, but if the actual output  
from which error messages you think “suck bowling balls through a  
garden hose” are not posted, they cannot be improved.

There are 148 lines featuring “raise” in RubyGems at present, and 89  
featuring “rescue”. I can’t psychically determine which of these  
raises and resuces failed you, so to improve things I’m going to need  
your help.

Remember, people volunteer to work on RubyGems. Complaining about the  
imperfections of a volunteer, open source effort without offering a  
helping hand does not encourage the volunteers that brought it to  
where it is today to continue devoting their valuable free time  
towards improving it.

> What I’m guessing is this: at some point in the gems update (which  
> always happens no matter how many times it caches the gem metadata  
> – read any number of a dozen other threads commenting on this by  
> now) a YAML file is being processed. And it’s failing for some  
> reason. And this failure gets reported in a confusing fashion that  
> makes it look like the error is caused by a missing YAML component.

The metadata update problem has been fixed (read rubygems-developers  
for details, or the ChangeLog in trunk) with a new metadata updater  
that does not perform updates the same way. Read any number of my  
responses to those dozen or so threads you’re mentioning for the past  
2-3 weeks. Release is twoish weeks off pending further bug fixes and  
feedback.

As for the error, I can only believe that you’re either out of date  
with your RubyGems installation, or you’re using an additional source  
that has an indexer that is out of date. RubyGems no longer uses YAML  
as its primary data source. It now uses Marshal exclusively.

---

<div class="post-metadata">

**Author:** ![dreamwave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/7feea3/32.png) [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Post date:** [June 11, 2008, 8:14am UTC](https://www.ruby-forum.com/t/gems-error-concerning-yaml/139925/8 "2008-06-11T08:14:16Z")

</div>

On Wed, 2008-06-11 at 03:16 +0900, Eric H. wrote:

> Since there’s no yaml gem, of course RubyGems will “choke” it.
> 
> Other package managers “choke” on things that don’t exist:

The problem is that rubygems’ error messages, frankly put, suck bowling  
balls through garden hoses. They’re basically the raised exception  
without any attempt whatsoever to actually report the conditions that  
led to the exception. (This, to me, defeats the whole point of  
exception-handling – exception raised at the point of detection,  
exception rescued at the point of knowing what went wrong, error message  
produced that explains situation – but this is neither here nor there.)

What I’m guessing is this: at some point in the gems update (which  
always happens no matter how many times it caches the gem metadata –  
read any number of a dozen other threads commenting on this by now) a  
YAML file is being processed. And it’s failing for some reason. And  
this failure gets reported in a confusing fashion that makes it look  
like the error is caused by a missing YAML component.
