RedCloth + Ruby installer 1.9.2p0

etd etd at nomejortu.com
Tue Nov 23 02:56:05 EST 2010


Hi Jason,

This worked. I didn't have to touch the Rake file and the .so files were
included in the gem. The gem ran flawlessly on the Windows box.

Many thanks for your support on getting this up and running.

The only thing I had to tweak was to comment out tasks/gems.rake#18

rvm ruby-1.8.6-p398 at redcloth rake cross compile RUBY_CC_VERSION=1.8.6

This is because my rake-compiler only had support for 1.9.1 but that is
more specific to my case.

I reckon that the hole rake-compiler business is a bit messy for people
not familiar with it so maybe adding a couple of basic steps in the
README will help people out. Something along the lines of what you have
when running rake build:win if rake-compiler is not properly configured.
Or maybe a wiki page in GitHub on how to get everything up and running
for cross-compilation (and a reference to it in the README).

Let me know if you need a hand with documentation, I'm more than happy
to spend some time putting that together if you think it would be of
use. Otherwise I may just write a blog post so I have it for myself in
case I need to run through this again.

Anyways, thank you very much for your time,

Daniel

On 23/11/2010 05:55, Jason Garber wrote:
> Daniel,
> I've fixed the README to include instructions about bundler and rvm and
> fixed the gem build tasks to include the proper files.  I tested it on
> Ruby installer 1.9.2p0.
> 
> You can try it out by pulling the latest from master or use the
> pre-compiled one I pushed up to rubygems.org <http://rubygems.org> with
> rake install RedCloth --pre
> 
> Let me know how it goes!
> Jason
> 
> On Sun, Nov 21, 2010 at 3:25 PM, etd <etd at nomejortu.com
> <mailto:etd at nomejortu.com>> wrote:
> 
> 
>     Thanks Jon and Jason,
> 
>     After some tweaks I was able to get the gem cross-compiled (from
>     master).
> 
>     First thing I had to do was amend the Rakefile to include after
>     'rake/clean' the following:
> 
>     require 'rake/gempackagetask'
> 
>     Otherwise I would get an error running rake.
> 
>     After that I installed ragel, rake-compiler, mingw32 and got that up and
>     running.
> 
>     Running rake gems:build also worked. It created a lib/redcloth_scan.so
>     and lib/1.9/redcloth_scan.so and a pkg/redcloth-4.2.3.gem
> 
>     Unfortunately this .gem didn't contain any of the .so files. Copying the
>     gem across to the Windows box would install Ok but then fail when
>     requiring 'redcloth' with:
> 
>     no such file to load -- 1.9/redcloth_scan
> 
>     So I copied the 1.9/ folder to by windows <rubygems\redcloth> path and
>     it worked like a charm.
> 
>     I guess that there is some tweaking around to be made in the gemspec to
>     ensure that the .so files are included in the gem file.
> 
>     Is this an easy fix? I'm asking because I've never distributed a Gem
>     myself and I was thinking that probably someone with more experience
>     will spot the issue more quickly.
> 
>     Many thanks for your help,
>     Daniel
> 
>     On 20/11/2010 14:37, Jason Garber wrote:
>     > Daniel,  I've been hard at work the last couple weeks on RedCloth.
>      Give
>     > the master <https://github.com/jgarber/redcloth> a try and let me know
>     > how it goes.  You'll need rake-compiler to cross-compile the fat
>     binary
>     > like Jon mentioned.  There is a very specific version of Ruby you need
>     > to make it work (1.9.1-p243), so use rvm as well.  rake gems:build
>     > should take care of everything, then.
>     >
>     > Thanks for giving it a test run.  I'm hoping to release it soon if
>     I can
>     > get a Java expert to help me fix the JRuby whitespace problem.
>     >
>     > Jason
>     >
>     > On Fri, Nov 19, 2010 at 1:53 PM, Jon <jon.forums at gmail.com
>     <mailto:jon.forums at gmail.com>
>     > <mailto:jon.forums at gmail.com <mailto:jon.forums at gmail.com>>> wrote:
>     >
>     >     > However, we are looking into upgrading Dradis to Rails 3 and
>     Ruby
>     >     1.9.2.
>     >     > Unfortunately, we are running into some issues in Windows
>     with the
>     >     Ruby
>     >     > Installer (1.9.2p0) and the binary version of RedCloth
>     >     > (RedCloth-4.2.2-x86-mswin32-60.gem). It installs ok but then
>     fails
>     >     when
>     >     > trying to load 'msvcrt-ruby18.dll'.
>     >
>     >     Hi Daniel,
>     >
>     >     One of the problems that you found was that the RedCloth
>     binary gem
>     >     was only built to support Ruby 1.8.  RedCloth would need to
>     provide
>     >     a version of its native .so library linked against the Ruby
>     1.9 DLL
>     >     in order to run correctly under Ruby 1.9.x.
>     >
>     >
>     >     > I have successfully used DevKit to compile and use RedCloth
>     4.2.3 in a
>     >     > test system, but I would like to be able to create a Ruby
>     Installer
>     >     > compatible binary gem to distribute it with the installer (thus
>     >     removing
>     >     > the extra dependency on DevKit for end users). Is this possible?
>     >     What is
>     >     > the best way to do this?
>     >
>     >     It's possible by creating what many call a "fat binary" gem.
>     >
>     >     A fat gem is basically one that includes a version of their native
>     >     library linked against 1.8 and a version linked against 1.9,
>     both in
>     >     the same gem.  At runtime, the gems code determines what Ruby
>     >     version it's running under and loads the correct native library.
>     >
>     >     Two well known libraries that do this are
>     >     https://github.com/tenderlove/nokogiri and
>     >     https://github.com/luislavena/sqlite3-ruby
>     >
>     >     I believe the authors of these mingw binary fat gems build them on
>     >     Linux or OSX using the tool
>     >     https://github.com/luislavena/rake-compiler which makes it
>     easy for
>     >     *nix-based gem authors to provide fat binary gems for their
>     Windows
>     >     users.
>     >
>     >     It would be great to have a fat binary RedCloth :)
>     >
>     >     If you have any questions on the rake-compiler tool after you
>     check
>     >     it out, search our group at
>     >     http://groups.google.com/group/rubyinstaller and if you can't find
>     >     anything that helps, post a question.  Luis (author of
>     >     rake-compiler) can point you in the right direction.
>     >
>     >     Jon
>     >     _______________________________________________
>     >     Redcloth-upwards mailing list
>     >     Redcloth-upwards at rubyforge.org
>     <mailto:Redcloth-upwards at rubyforge.org>
>     <mailto:Redcloth-upwards at rubyforge.org
>     <mailto:Redcloth-upwards at rubyforge.org>>
>     >     http://rubyforge.org/mailman/listinfo/redcloth-upwards
>     >
>     >
>     >
>     >
>     > _______________________________________________
>     > Redcloth-upwards mailing list
>     > Redcloth-upwards at rubyforge.org <mailto:Redcloth-upwards at rubyforge.org>
>     > http://rubyforge.org/mailman/listinfo/redcloth-upwards
> 
> 
> 
> 
> _______________________________________________
> Redcloth-upwards mailing list
> Redcloth-upwards at rubyforge.org
> http://rubyforge.org/mailman/listinfo/redcloth-upwards


More information about the Redcloth-upwards mailing list