Ad

Failing To Install Jekyll Gem Native Extension On Windows With "multiple Target Patterns"

- 1 answer

I'm trying to get Jekyll up and running on my Windows 7 machine, but installing the gem fails with a make exception. I'm basically following the instructions provided by Madhur Arhuja plus some "fixes" due to some seemingly wrong links. Here is what I did:

Downloaded and installed ruby 1.9.3 p448

Downloaded and extracted the RubyDevelopmentKit from the same page.

In my Git Bash from the directory where I installed the development kit I ran

ruby dk.rb init
ruby dk.rb install
gem install jekyll

The first two steps worked fine. I got some Info output, no errors. But the last step created this:

$ gem install jekyll
Fetching: liquid-2.5.1.gem (100%)
Fetching: fast-stemmer-1.0.2.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
    ERROR: Failed to build gem native extension.

    "c:/Program Files/Ruby193/bin/ruby.exe" extconf.rb
creating Makefile

make
Makefile:222: *** multiple target patterns.  Stop.


Gem files will remain installed in c:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2 for inspection.
Results logged to c:/Program Files/Ruby193/lib/ruby/gems/1.9.1/gems/fast-stemmer-1.0.2/ext/gem_make.out

In Very simple application fails with "multiple target patterns" from Eclipse I found that this might be related to the unix emulator, so I ran the last command again in the windows shell, but with the same result.

Since I have no idea about ruby, c, make or anything involved I'm completely stuck :-(

Ad

Answer

Ok just a try. The Makefile on this line (and following) defines the target for .m.o.

$(Q) $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) $(COUTFLAG)[email protected] -c $<

Everything looks ok if you're using mingw / cygwin, but INCFLAGS can make problems on window machines, if you've installed ruby in a directory with spaces. INCFLAG is defined as INCFLAGS = -I. -I$(arch_hdrdir) -I$(hdrdir)/ruby/backward -I$(hdrdir) -I$(srcdir) and if you see my definition below there is no space in any path.

topdir = /C/Ruby200-x64/include/ruby-2.0.0
hdrdir = $(topdir)
arch_hdrdir = C:/Ruby200-x64/include/ruby-2.0.0/x64-mingw32

If I change the ruby installation to a path with spaces I get invalid option error in native windows command line and in the mingw session. Maybe this is could help.

Ad
source: stackoverflow.com
Ad