socketry / multipart-post

Adds multipart POST capability to net/http
MIT License
293 stars 72 forks source link

NoMethodError: undefined method `alphanumeric' for SecureRandom:Module #61

Closed apepper closed 5 years ago

apepper commented 5 years ago

If you're using multipart-post version 2.1.0 with ruby version 2.4.1p111 you'll receive the following exception:

NoMethodError: undefined method `alphanumeric' for SecureRandom:Module

This is because SecureRandom.alphanumeric was added to ruby in version 2.5.0 (see https://github.com/ruby/ruby/commit/b867882a1c2a358bb7a46f84365c86a959d35240 and https://github.com/ruby/ruby/blob/v2_5_0/NEWS).

Ruby 2.4 is still supported by the ruby language team.

Currently you have to downgrade multipart-post to version 2.0.0, or upgrade the ruby to at least version 2.5.0.

See https://github.com/socketry/multipart-post/commit/a8bccb99f020594500bf7e84a05471888d9a93f5 for the introducing commit.

ioquatix commented 5 years ago

I wonder why this wasn’t picked up by travis.

ioquatix commented 5 years ago

Okay, the travis tests were completely borked. I've fixed them, and I'm now updating it to use SecureRandom.uuid which is supported all the way back to 2.0.

ioquatix commented 5 years ago

Fixed in v2.1.1.