4 ms·
I used to develop Ruby C extensions a lot, but I'm just now getting back into the game. What Ruby versions are considered "current" enough that libraries need
by haberman 12y ago
I used to develop Ruby C extensions a lot, but I'm just now getting back into the game. What Ruby versions are considered "current" enough that libraries need to support them? Is the 1.9 line still in wide use? How far back in the 2.1 line is in common use?
Normally I wouldn't worry too much about this, except that I've heard that the Ruby C API changes substantially from release to release. Is this true? Anything in particular to watch out for?
- gkop 12y agoYou can expect libraries to follow Rails' lead. The current rails (4.x) supports 1.9, but next year's rails (5.0) will require 2.x. So about the time that rails 5 comes out I would try to be ready to run 2.x in order to enjoy library compatibility.
- andyl 12y agoI believe Rails5 will require Ruby 2.2.x (which does garbage collection on symbols).
- haberman 12y agoThat makes sense. According to the download page (http://rubyonrails.org/download/ http://rubyonrails.org/download/), the current Rails version requires Ruby 1.9.3 or newer. Hopefully testing with Ruby 1.9.3 and the newest (Ruby 2.1.3) will give enough assurance that it works on all the versions in between.
- dragonwriter 12y ago> The current rails (4.x) supports 1.9, but next year's rails (5.0) will require 2.x. The recent Ruby 2.2-preview1 announcement included a statement that the upcoming Rails 5.0 would require Ruby 2.2 (which should have a general release this Christmas), not just 2.x.
- dragonwriter 12y agoI believe Ruby-FFI, if it does what you need, is more stable across Ruby versions than the Ruby C API, its also, unlike the C extension API, usable across Ruby implementations -- MRI, Rubinius, and JRuby all support it (not sure if any of the other implementations do.)