# Gems error concerning yaml

**URL:** <https://rubytalk.org/t/gems-error-concerning-yaml/47019>\
**Category:** ruby-talk\
**Created:** [9 June 2008 05:52 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019 "2008-06-09T05:52:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Litchard](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Michael\_Litchard](https://rubytalk.org/u/Michael_Litchard)\
**Post date:** [9 June 2008 05:52 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/1 "2008-06-09T05:52:24Z")

</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 Litchard

---

<div class="post-metadata">

**Author:** ![jemminger](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@jemminger](https://rubytalk.org/u/jemminger)\
**Post date:** [9 June 2008 06:13 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/2 "2008-06-09T06:13:38Z")

</div>

eh, AFAIK yaml comes with the base ruby install.

> **···**
>
> On Jun 9, 1:52 am, Michael Litchard \<mich...@schmong.org\> wrote:
> 
> > [Note: parts of this message were removed to make it a legal post.]
> > 
> > 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 Litchard

---

<div class="post-metadata">

**Author:** ![Michael\_Litchard](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Michael\_Litchard](https://rubytalk.org/u/Michael_Litchard)\
**Post date:** [9 June 2008 07:03 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/3 "2008-06-09T07:03:39Z")

</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.

> **···**
>
> On Sun, Jun 8, 2008 at 11:13 PM, jemminger \<jemminger@gmail.com\> wrote:
> 
> > On Jun 9, 1:52 am, Michael Litchard \<mich...@schmong.org\> wrote:  
> > \> [Note: parts of this message were removed to make it a legal post.]  
> > \>  
> > \> 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 Litchard
> > 
> > eh, AFAIK yaml comes with the base ruby install.

---

<div class="post-metadata">

**Author:** ![David\_Masover](https://avatars.discourse-cdn.com/v4/letter/d/50afbb/32.png) [@David\_Masover](https://rubytalk.org/u/David_Masover)\
**Post date:** [9 June 2008 07:58 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/4 "2008-06-09T07:58:48Z")

</div>

> 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"?

> **···**
>
> On Monday 09 June 2008 02:03:39 Michael Litchard wrote:

---

<div class="post-metadata">

**Author:** ![Michael\_Litchard](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@Michael\_Litchard](https://rubytalk.org/u/Michael_Litchard)\
**Post date:** [9 June 2008 16:57 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/5 "2008-06-09T16:57:42Z")

</div>

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).

> **···**
>
> On Mon, Jun 9, 2008 at 12:58 AM, David Masover \<ninja@slaphack.com\> 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"?

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [10 June 2008 18:16 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/6 "2008-06-10T18:16:28Z")

</div>

> > 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.

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

> **···**
>
> On Jun 9, 2008, at 09:57 AM, Michael Litchard wrote:
> 
> > On Mon, Jun 9, 2008 at 12:58 AM, David Masover \<ninja@slaphack.com\> \> wrote:

---

<div class="post-metadata">

**Author:** ![Michael\_T\_Richter](https://avatars.discourse-cdn.com/v4/letter/m/9d8465/32.png) [@Michael\_T\_Richter](https://rubytalk.org/u/Michael_T_Richter)\
**Post date:** [11 June 2008 06:13 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/7 "2008-06-11T06:13:05Z")

</div>

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.

> **···**
>
> On Wed, 2008-06-11 at 03:16 +0900, Eric Hodel wrote:
> 
> > Since there's no yaml gem, of course RubyGems will "choke" it.
> > 
> > Other package managers "choke" on things that don't exist:
> 
> --  
> Michael T. Richter \<ttmrichter@gmail.com\> (GoogleTalk:  
> ttmrichter@gmail.com)  
> A well-designed and humane interface does not need to be split into  
> beginner and expert subsystems. (Jef Raskin)

---

<div class="post-metadata">

**Author:** ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)\
**Post date:** [11 June 2008 18:42 UTC](https://rubytalk.org/t/gems-error-concerning-yaml/47019/8 "2008-06-11T18:42:31Z")

</div>

> > 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.)

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.

> **···**
>
> On Jun 10, 2008, at 23:13 PM, Michael T. Richter wrote:
> 
> > On Wed, 2008-06-11 at 03:16 +0900, Eric Hodel wrote:
