chef / ffi-yajl

Ruby FFI gem wrapper around yajl2 library
MIT License
11 stars 21 forks source link

Cannot install latest gem on Ruby 2.1 #88

Closed AnalogJ closed 7 years ago

AnalogJ commented 7 years ago

When installing the latest version of ffi-yajl on ruby 2.1, we get the following error:

$ gem install ffi-yajl
ERROR:  Error installing ffi-yajl:
    ffi-yajl requires Ruby version >= 2.2.

$ gem install ffi-yajl -v '2.3.1'
ERROR:  Error installing ffi-yajl:
    ffi-yajl requires Ruby version >= 2.2.

Here's my version info:

$ ruby --version
ruby 2.1.8p440 (2015-12-16 revision 53160) [x86_64-linux]

$ chef --version
Chef Development Kit Version: 0.16.28
chef-client version: 12.12.15
delivery version: master (921828facad8a8bbbd767368bfc72f19bd30e7bd)
berks version: 4.3.5
kitchen version: 1.10.2
tas50 commented 7 years ago

@AnalogJ With the last release of this gem we bumped the requirements to Ruby 2.2 or later. Ruby 2.1 is actually EoL now so we're not going to be supporting it any further. You can upgrade to a more recent version of ChefDK and you'll get an updated version of Ruby which should resolve this issue.

AnalogJ commented 7 years ago

That makes sense, however that first unconditional gem install ffi-yajl command should still have worked. Bundler/Gem should just install the latest version that can run successfully on ruby 2.1.

https://github.com/chef/ffi-yajl/blob/master/ffi-yajl.gemspec.shared#L15

Something's wrong here.

tas50 commented 7 years ago

Older bundler isn't actually smart enough to resolve to a gem that depends on the ruby version you have. It should, but it doesn't. I believe the latest versions of bundler have some large improvements on that front. Again updating to a new ChefDK would probably resolve that problem going forward since you'd get a new bundler release.