<p></p>
<p dir="auto">In <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2000378435" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4353" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4353/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4353">#4353</a> we propose using a new gem, which will trigger an error if you are running rubygems < 3.4.9.</p>
<hr>
<p dir="auto">TLDR: if you run into an error message like:</p>
<pre class="notranslate"><code class="notranslate">/home/andy/.rbenv/versions/3.0.6/lib/ruby/3.0.0/psych.rb:457:in `parse_stream': undefined method `parse' for #<Psych::Parser:0x000055ef0ca09e38 @handler=#<Psych::Handlers::DocumentStream:0x000055ef0ca09f78
@stack=[], @last=nil, @root=nil, @start_line=nil, @start_column=nil, @end_line=nil, @end_column=nil, @block=#<Proc:0x000055ef0ca09e88 /home/andy/.rbenv/versions/3.0.6/lib/ruby/3.0.0/psych.rb:391>>,
@external_encoding=0> (NoMethodError)
</code></pre>
<p dir="auto">then that's because the version of rubygems that you are using (perhaps the version that shipped with your ruby installation) is outdated and has a bug. To fix it, either upgrade to ruby 3.2+, or run:</p>
<pre class="notranslate"><code class="notranslate">gem update --system
</code></pre>
<hr>
<p dir="auto">This is going to catch a lot of developers I think, perhaps everyone who follows the installation guide. <a href="https://launchpad.net/ubuntu/jammy/+package/ruby-rubygems" rel="nofollow">Ubuntu 22.04 has rubygems 3.3.5</a> for example. I did some research, and to avoid the bug you need either:</p>
<ul dir="auto">
<li>A version of ruby that ships with psych 5+, or</li>
<li>rubygems 3.4.9+</li>
</ul>
<p dir="auto">For some recent ruby releases, it ships with the following versions included:</p>
<ul dir="auto">
<li>ruby 3.2.2 = rubygems 3.4.10, psych 5.0.1 (fine on both counts)</li>
<li>ruby 3.2.1 = rubygems 3.4.6 , psych 5.0.1 (psych is new enough)</li>
<li>ruby 3.1.4 = rubygems 3.3.26, psych 4.0.4 (rubygems is too old)</li>
<li>ruby 3.0.6 = rubygems 3.2.33, psych 3.3.2 (rubygems is too old)</li>
</ul>
<p dir="auto">So if you are on ruby 3.2 you'll be fine and won't notice anything, but previous versions you'll run into the cryptic error message. The task here is to make the fix (i.e. run <code class="notranslate">gem update --system</code>) as obvious to our developers as possible.</p>
<p dir="auto">Do you think we should add another step to the installation guide to cover this? I can't think of any other way to catch the problem before a new developer runs into it, it's going to happen before any code that we write is run, so there's no opportunity to show a better error message.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/4364">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJJO4ICQVL73ZZEMGLYFYSA3AVCNFSM6AAAAAA7WQNCY6VHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDMNZRGA2TGMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLXYNFRTQIQENKK7ZTYFYSA3A5CNFSM6AAAAAA7WQNCY6WGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHPG7ZAU.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/4364</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/4364",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/4364",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>