jgarber / redcloth

RedCloth is a Ruby library for converting Textile into HTML.
Other
443 stars 113 forks source link

Ruby 2.7 on Windows tries to load the wrong file #61

Closed mohits closed 8 months ago

mohits commented 4 years ago

I realise now that this issue is similar to #51

I'm not sure if this is an issue with the way that Ruby 2.7 (with MSYS2) set up by RubyInstaller + DevKit2 builds the files or if it is an issue in lib/redcloth.rb but the problem is such.

When you require 'redcloth' it fails with an error that it can't load redcloth_scan(.so) - the file is in the same directory (lib) but the code at the start looks for "2.7/redcloth_scan.so" (since the 'x64-mingw32' matches the regex in this line: prefix = conf['arch'] =~ /mswin|mingw/ ? "#{conf['MAJOR']}.#{conf['MINOR']}/" : ''

Keeping the prefix blank ('') and requiring just 'redcloth_scan.so' works perfectly well.

Version: RedCloth 4.3.2 Ruby: ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x64-mingw32] Rubygems: 3.1.2 Bundler: 2.1.4

For reference, my Ruby 2.2 installation does have: lib/2.2/redcloth_scan.so

Happy to help if I can. The rest of it seems to work fine since I tried to use it to try to compile my Jekyll site, and the preview looks fine after that change.

joshuasiler commented 4 years ago

We do not have any contributors working on maintaining windows compatibility, so it's unlikely this will be incorporated until that changes. Do you wish join this project as a maintainer?

mohits commented 4 years ago

I'm happy to help though my experience with creating and/ or maintaining Gems is quite limited :(

The change breaks nothing on any platform since it is a pure Ruby change, and it only does a double require with exception catching.

I can think of a couple of ways to help:

heliocola commented 8 months ago

This issue has been closed by #62 .