[openstreetmap/openstreetmap-website] Many developers will need to upgrade their rubygems (Issue #4364)
Andy Allan
notifications at github.com
Wed Nov 22 16:30:05 UTC 2023
In #4353 we propose using a new gem, which will trigger an error if you are running rubygems < 3.4.9.
---
TLDR: if you run into an error message like:
```
/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)
```
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:
```
gem update --system
```
---
This is going to catch a lot of developers I think, perhaps everyone who follows the installation guide. [Ubuntu 22.04 has rubygems 3.3.5](https://launchpad.net/ubuntu/jammy/+package/ruby-rubygems) for example. I did some research, and to avoid the bug you need either:
* A version of ruby that ships with psych 5+, or
* rubygems 3.4.9+
For some recent ruby releases, it ships with the following versions included:
- ruby 3.2.2 = rubygems 3.4.10, psych 5.0.1 (fine on both counts)
- ruby 3.2.1 = rubygems 3.4.6 , psych 5.0.1 (psych is new enough)
- ruby 3.1.4 = rubygems 3.3.26, psych 4.0.4 (rubygems is too old)
- ruby 3.0.6 = rubygems 3.2.33, psych 3.3.2 (rubygems is too old)
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 `gem update --system`) as obvious to our developers as possible.
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.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/4364
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/4364 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231122/e8df3d12/attachment.htm>
More information about the rails-dev
mailing list