Install problem with Cygwin on Win7

690 views
Skip to first unread message

Robert Martin

unread,
Feb 24, 2015, 5:25:45 PM2/24/15
to nokogi...@googlegroups.com
I'm trying to install rails on cygwin and am running into problems when the install tries to install nokogiri.

There are a few messages like this before it exits:

nokogiri.c: In function `Init_nokogiri':
nokogiri.c:100:3: error: stray `\' in program
   rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), NOKOGIRI_STR_NEW2
(NOKOGIRI_LIBXML2_PATH));

And this looks like it's related to the CPPFLAGS variable

-DHAVE_XMLPARSEDOC -DHAVE_XSLTPARSESTYLESHEETDOC -DHAVE_
EXSLTFUNCREGISTER -DHAVE_XMLHASFEATURE -DHAVE_XMLFIRSTELEMENTCHILD -DHAVE_XMLREL
AXNGSETPARSERSTRUCTUREDERRORS -DHAVE_XMLRELAXNGSETPARSERSTRUCTUREDERRORS -DHAVE_
XMLRELAXNGSETVALIDSTRUCTUREDERRORS -DHAVE_XMLSCHEMASETVALIDSTRUCTUREDERRORS -DHA
VE_XMLSCHEMASETPARSERSTRUCTUREDERRORS -I/home/robertm/.gem/ruby/gems/nokogiri-1.
6.6.2/ports/x86_64-unknown-cygwin/libxslt/1.1.28/include -I/home/robertm/.gem/ru
by/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cygwin/libxml2/2.9.2/include/libxm
l2 -DLIBXML_STATIC -I/home/robertm/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-
unknown-cygwin/libxml2/2.9.2/include/libxml2 -DLIBXML_STATIC    -DNOKOGIRI_LIBXM
L2_PATH\=\"/home/robertm/.gem/ruby/gems/nokogiri-1.6.6.2/ports/x86_64-unknown-cy
gwin/libxml2/2.9.2\" -DNOKOGIRI_LIBXML2_PATCHES\=\"0001-Revert-Missing-initializ
ation-for-the-catalog-module.patch\ 0002-Fix-missing-entities-after-CVE-2014-366
0-fix.patch\" -DNOKOGIRI_LIBXSLT_PATH\=\"/home/robertm/.gem/ruby/gems/nokogiri-1
.6.6.2/ports/x86_64-unknown-cygwin/libxslt/1.1.28\" -DNOKOGIRI_LIBXSLT_PATCHES\=
\"0001-Adding-doc-update-related-to-1.1.28.patch\ 0002-Fix-a-couple-of-places-wh
ere-f-printf-parameters-wer.patch\ 0003-Initialize-pseudo-random-number-generato
r-with-curre.patch\ 0004-EXSLT-function-str-replace-is-broken-as-is.patch\ 0006-
Fix-str-padding-to-work-with-UTF-8-strings.patch\ 0007-Separate-function-for-pre
dicate-matching-in-patterns.patch\ 0008-Fix-direct-pattern-matching.patch\ 0009-
Fix-certain-patterns-with-predicates.patch\ 0010-Fix-handling-of-UTF-8-strings-i
n-EXSLT-crypto-module.patch\ 0013-Memory-leak-in-xsltCompileIdKeyPattern-error-p
ath.patch\ 0014-Fix-for-bug-436589.patch\ 0015-Fix-mkdir-for-mingw.patch\"  -ggd
b -O2 -pipe -Wimplicit-function-declaration    -g -DXP_UNIX -Wall -Wcast-qual -W
write-strings -Wconversion -Wmissing-noreturn -Winline -DNOKOGIRI_USE_PACKAGED_L
IBRARIES  -o nokogiri.o -c nokogiri.c

For some reason the -DNOKOGIRI* environment vars look wrong and I can't figure out how to fix/prevent this.

Has anyone come across this before and happen to know how to fix it?

Thanks

Mike Dalessio

unread,
Mar 2, 2015, 9:36:55 AM3/2/15
to nokogiri-talk
We don't currently support native building of Nokogiri. Ongoing discussion here: https://github.com/sparklemotion/nokogiri/issues/1190

Instead, please prefer one of the windows-platform gems that contain pre-built DLLs.

That said, I have no idea whether our Windows gems work for Cygwin; we've only tested against the Ruby one-click installer. Would love to hear how you get on.



--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nokogiri-tal...@googlegroups.com.
To post to this group, send email to nokogi...@googlegroups.com.
Visit this group at http://groups.google.com/group/nokogiri-talk.
For more options, visit https://groups.google.com/d/optout.

Tiou Lims

unread,
Mar 8, 2015, 11:21:33 PM3/8/15
to nokogi...@googlegroups.com
Same issue on 1.6.6.2, But 1.5.0 is fine.

nokogiri -v                                                                                                                                                                                    
# Nokogiri (1.5.0)
   
---
    warnings
: []
    nokogiri
: 1.5.0
    ruby
:
      version
: 2.0.0
      platform
: x86_64-cygwin
      description
: ruby 2.0.0p598 (2014-11-13) [x86_64-cygwin]
      engine
: ruby
    libxml
:
      binding
: extension
      compiled
: 2.9.2
      loaded
: 2.9.2



Robert Martin於 2015年2月25日星期三 UTC+8上午6時25分45秒寫道:

Robert Klemme

unread,
Mar 11, 2015, 6:32:27 AM3/11/15
to nokogi...@googlegroups.com


On Monday, March 2, 2015 at 3:36:55 PM UTC+1, Mike Dalessio wrote:
We don't currently support native building of Nokogiri. Ongoing discussion here: https://github.com/sparklemotion/nokogiri/issues/1190

Instead, please prefer one of the windows-platform gems that contain pre-built DLLs.

That said, I have no idea whether our Windows gems work for Cygwin; we've only tested against the Ruby one-click installer. Would love to hear how you get on.

Not sure where my reply from yesterday went. Basically I also cannot install Nokogiri on Cygwin since version 1.6.6.2. It worked OK with 1.6.6.1. I can provide more details but would not want to duplicate what I wrote yesterday in case the message surfaces.

Should I rather open a bug for that or do we discuss this here?

Kind regards

robert 

Robert Klemme

unread,
Mar 11, 2015, 6:32:29 AM3/11/15
to nokogi...@googlegroups.com


On Monday, March 2, 2015 at 3:36:55 PM UTC+1, Mike Dalessio wrote:
We don't currently support native building of Nokogiri. Ongoing discussion here: https://github.com/sparklemotion/nokogiri/issues/1190

Do you mean you do not support building Nokogiri on Windows? Or do you mean you do not support building on Cygwin? The latter would be odd because up until 1.6.6.1 I could install and build Nokogiri on Cygwin with gcc without issues.

I also believe a Cygwin build is more similar to a Linux build than a native Windows build. configure works there and paths and process handling are more like on Linux.
 
Instead, please prefer one of the windows-platform gems that contain pre-built DLLs.

That said, I have no idea whether our Windows gems work for Cygwin; we've only tested against the Ruby one-click installer. Would love to hear how you get on.

Most likely it will not be compatible. On cygwin shared libs are .so and I am not sure how Windows DLLs would be loaded. Maybe there is a way but I'd rather not go down that route.
I am having the same issue here. My details:

$ uname -a
CYGWIN_NT-6.1 arnie 1.7.35(0.287/5/3) 2015-03-04 12:09 x86_64 Cygwin
$ gcc --version
gcc (GCC) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ruby --version
ruby 2.0.0p598 (2014-11-13) [x86_64-cygwin]
 
I can provide my last successful gem_make.out and the one for 1.6.6.2 if that helps. Should we open a bug?

Kind regards

robert

Mike Dalessio

unread,
Mar 11, 2015, 6:37:28 AM3/11/15
to nokogiri-talk

Robert,

Thanks for asking this question.

Please send all your logs so we can see what's going on that's causing the failure.

As I said, we don't officially support cygwin, so this is not a bug; but I'm happy to help you out if it's easy to fix in your case.

--

Robert Klemme

unread,
Mar 11, 2015, 8:03:59 AM3/11/15
to nokogi...@googlegroups.com
Hi Mike!

On Wed, Mar 11, 2015 at 11:37 AM, Mike Dalessio <mike.d...@gmail.com> wrote:

Robert,

Thanks for asking this question.

Please send all your logs so we can see what's going on that's causing the failure.


OK.  I have attached gem_make.out from the 1.6.6.1 and 1.6.6.2 builds. As the original message (below) indicates this seems to be some issue with CPP macros. Versions of Cygwin and compiler can be found at the bottom of my last email (see below).

As I said, we don't officially support cygwin, so this is not a bug; but I'm happy to help you out if it's easy to fix in your case.

Thank you! 

Kind regards

robert

--
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can - without end}
http://blog.rubybestpractices.com/
nokogiri-1.6.6.1-gem_make.out.gz
nokogiri-1.6.6.2-gem_make.out.gz

Robert Klemme

unread,
Mar 19, 2015, 4:49:53 AM3/19/15
to nokogi...@googlegroups.com


On Wednesday, March 11, 2015 at 1:03:59 PM UTC+1, Robert Klemme wrote:
Hi Mike!


On Wed, Mar 11, 2015 at 11:37 AM, Mike Dalessio wrote:

Robert,

Thanks for asking this question.

Please send all your logs so we can see what's going on that's causing the failure.


OK.  I have attached gem_make.out from the 1.6.6.1 and 1.6.6.2 builds. As the original message (below) indicates this seems to be some issue with CPP macros. Versions of Cygwin and compiler can be found at the bottom of my last email (see below).

As I said, we don't officially support cygwin, so this is not a bug; but I'm happy to help you out if it's easy to fix in your case.

Thank you! 

Could you make any use of the logs I provided? Do you need more information?

Kind regards

robert

Mike Dalessio

unread,
Mar 24, 2015, 8:01:51 AM3/24/15
to nokogiri-talk
Hi,

The error in the log, as you presumably have seen is:

```
nokogiri.c: In function 'Init_nokogiri':
nokogiri.c:100:3: error: stray '\' in program
   rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATH));
   ^
```

This string comes from the mini_portile recipe and is passed in via a compiler command-line option (see https://github.com/sparklemotion/nokogiri/blob/master/ext/nokogiri/extconf.rb#L529).

Are you using two different gemsets for your 1.6.6.1 and your 1.6.6.2 installations? If so, can you tell me what versions of mini_portile you're using in each?


--

Robert Klemme

unread,
Mar 24, 2015, 10:46:44 AM3/24/15
to nokogi...@googlegroups.com

Hi again!

On Tue, Mar 24, 2015 at 1:01 PM, Mike Dalessio <mike.d...@gmail.com> wrote:
Hi,

The error in the log, as you presumably have seen is:

```
nokogiri.c: In function 'Init_nokogiri':
nokogiri.c:100:3: error: stray '\' in program
   rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATH));
   ^
```

Right.
 
This string comes from the mini_portile recipe and is passed in via a compiler command-line option (see https://github.com/sparklemotion/nokogiri/blob/master/ext/nokogiri/extconf.rb#L529).

Are you using two different gemsets for your 1.6.6.1 and your 1.6.6.2 installations?

No.
 
If so, can you tell me what versions of mini_portile you're using in each?

$ gem list -l

*** LOCAL GEMS ***

domain_name (0.5.23)
http-cookie (1.0.2)
io-console (0.4.2)
json (1.8.2, 1.8.1)
mechanize (2.7.3)
mime-types (2.4.3)
mini_portile (0.6.2)
minitest (5.5.1, 4.7.5)
net-http-digest_auth (1.4)
net-http-persistent (2.9.4)
nokogiri (1.6.6.1)
ntlm-http (0.1.1)
psych (2.0.13, 2.0.6)
rake (10.4.2, 10.3.2)
rdoc (4.2.0, 4.1.2)
unf (0.1.4)
unf_ext (0.0.6)
webrobots (0.1.1)

Kind regards

robert

Robert Klemme

unread,
Apr 14, 2015, 4:43:06 AM4/14/15
to nokogi...@googlegroups.com


On Tuesday, March 24, 2015 at 3:46:44 PM UTC+1, Robert Klemme wrote:

Hi again!


On Tue, Mar 24, 2015 at 1:01 PM, Mike Dalessio wrote:
Hi,

The error in the log, as you presumably have seen is:

```
nokogiri.c: In function 'Init_nokogiri':
nokogiri.c:100:3: error: stray '\' in program
   rb_const_set(mNokogiri, rb_intern("NOKOGIRI_LIBXML2_PATH"), NOKOGIRI_STR_NEW2(NOKOGIRI_LIBXML2_PATH));
   ^
```

Right.

I tested again today and got an error I did not notice before:

<command-line>:0:22: warning: missing whitespace after the macro name

I have attached /usr/lib/gems/ruby/2.0.0/nokogiri-1.6.6.2/gem_make.out (compressed).

Do you have any insights yet?

Kind regards

robert
gem_make.out.gz

Rubens Farias

unread,
Sep 13, 2015, 4:44:47 PM9/13/15
to nokogiri-talk
I was wondering, did anyone have any progress on this?

I stumbled on the same problem... :'(

Mike Dalessio

unread,
Sep 13, 2015, 4:47:01 PM9/13/15
to nokogiri-talk

Hi,

The 1.6.7 release candidate supports native builds on Windows, but I have no idea whether Cygwin will work.

Try it and let us know?

--

Rubens Farias

unread,
Sep 13, 2015, 6:29:32 PM9/13/15
to nokogiri-talk
Installing 1.6.7 works fine! Thanks!


On Tuesday, February 24, 2015 at 6:25:45 PM UTC-4, Robert Martin wrote:

Joe Herrera

unread,
Sep 13, 2015, 7:44:27 PM9/13/15
to nokogiri-talk
How did you install 1.6.7, compiling with DevKit?

Mike Dalessio

unread,
Sep 13, 2015, 7:46:02 PM9/13/15
to nokogiri-talk

Yes, we build and test against the Ruby one-click installer devkit.

1.6.7 final should be cut in the next few days.

--

Rubens Farias

unread,
Sep 14, 2015, 11:23:27 AM9/14/15
to nokogiri-talk
I downloaded the gem and installed it with gem install from cygwin.

Nice! Looking forward to the final 1.6.7.


On Tuesday, February 24, 2015 at 6:25:45 PM UTC-4, Robert Martin wrote:
Reply all
Reply to author
Forward
0 new messages