thecodecrate/city-state

"No such file or directory @ rb_sysopen <url>" when attempting update

Opened this issue · 0 comments

When executing CS.update, I receive the following error:

No such file or directory @ rb_sysopen - https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City-CSV&license_key=redacted&suffix=zip (Errno::ENOENT)    

The update_maxmind method is using OpenURI as just open(), which is an override of Kernel#open, but such use was deprecated in Ruby 2.7.

This was changed in OpenURI in Commit #0c2986a, roughly a year before the current v0.2.0 was released.

The solution here is to either:

  • Require Ruby <= v2.5 and lock dependency on 'open-uri' gem to v0.1.0
  • Or update Line 42 to use URI.open() instead of just open()