davidfstr / rdiscount

Discount (For Ruby) Implementation of John Gruber's Markdown
http://dafoster.net/projects/rdiscount/
Other
753 stars 70 forks source link

rdiscount doesn't build on Windows 7 with Ruby 2.1.5 (32 bit) #122

Closed simoneau closed 9 years ago

simoneau commented 9 years ago

I'm having trouble building rdiscount on Windows 7 with Ruby 2.1.5 (32 bit):

C:\Users\Matthew>ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]

C:\Users\Matthew>gem install rdiscount
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rdiscount:
        ERROR: Failed to build gem native extension.

    C:/Ruby21/bin/ruby.exe extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby21/bin/ruby
        --with-rdiscount-dir
        --without-rdiscount-dir
        --with-rdiscount-include
        --without-rdiscount-include=${rdiscount-dir}/include
        --with-rdiscount-lib
        --without-rdiscount-lib=${rdiscount-dir}/lib
C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:705:in `Integer': can't convert nil into Integer (TypeError)
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:705:in `block in try_constant'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:408:in `popen'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:408:in `block in xpopen'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in `open'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:401:in `xpopen'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:704:in `try_constant'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:1309:in `block in check_sizeof'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in `open'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:321:in `open'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
        from C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:1308:in `check_sizeof'
        from extconf.rb:11:in `block in sized_int'
        from extconf.rb:11:in `each'
        from extconf.rb:11:in `find'
        from extconf.rb:11:in `sized_int'
        from extconf.rb:15:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby21/lib/ruby/gems/2.1.0/gems/rdiscount-2.1.7.1 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/rdiscount-2.1.7.1/gem_make.out

For comparison, it succeeds with Ruby 1.9.3:

C:\Users\Matthew>ruby -v
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]

C:\Users\Matthew>gem install rdiscount
Fetching: rdiscount-2.1.7.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rdiscount-2.1.7.1
1 gem installed
Installing ri documentation for rdiscount-2.1.7.1...
Installing RDoc documentation for rdiscount-2.1.7.1...

Any suggestions would be greatly appreciated!

davidfstr commented 9 years ago

Probably Ruby broke something in later versions of their C extension system. If so I'm rather bummed that Travis didn't say anything.

I'll try to take a look this weekend. In the meantime, you can try debugging yourself by reading through the BUILDING file at the root level, particularly the section detailing troubleshooting steps related to the C extension.

simoneau commented 9 years ago

Thanks for taking a look David. I was able to get back on track by downgrading to Ruby 1.9.3, so I'm no longer blocked. Triage as you see fit, and let me know if there's anything I can do to help.

davidfstr commented 9 years ago

I was able to install successfully using the exact same version of Ruby and RDiscount on a Windows 7 (32-bit) virtual machine.

C:\Users\davidf\RD>ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [i386-mingw32]
C:\Users\davidf\RD>gem install rdiscount
Fetching: rdiscount-2.1.7.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed rdiscount-2.1.7.1
Parsing documentation for rdiscount-2.1.7.1
Installing ri documentation for rdiscount-2.1.7.1
Done installing documentation for rdiscount after 1 seconds
1 gem installed

Granted I did have to manually install a certain cacert.pem to fix SSL errors anytime the gem tool wanted to do something.

Perhaps you are using a 64-bit version of Windows instead of a 32-bit one? Or perhaps you installed the 64-bit version of DevKit instead of the 32-bit one?

davidfstr commented 9 years ago

Closing due to lack of response.

shjustinzhang commented 2 years ago

Quick check : Granted I did have to manually install a certain cacert.pem to fix SSL errors anytime the gem tool wanted to do something.

How to install a certain cacert.pem to fix SSL errors ?

shjustinzhang commented 2 years ago

OK, NVM I figure it out

Put the cacert.pem under Ruby folder , such as mine C:\Ruby22-x64