gjtorikian / commonmarker

Ruby wrapper for the comrak (CommonMark parser) Rust crate
MIT License
429 stars 82 forks source link

Cannot bundle commonmarker due to cmake #47

Closed nynhex closed 7 years ago

nynhex commented 7 years ago

Env:

Rails 5.1, Ruby 2.4.0, Commonmarker 0.16.0

When trying to install the gem via bundle after specifying it in my gemfile, I get this exception:

I'm on MacOS Sierra if it helps.

Installing commonmarker 0.16.0 with native extensions
Using activesupport 5.1.1
Using loofah 2.0.3
Using mail 2.6.5
Using bootstrap 4.0.0.alpha6
Using listen 3.0.8
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/commonmarker-0.16.0/ext/commonmarker
/Users/nynhex/.rbenv/versions/2.4.0/bin/ruby -r ./siteconf20170613-3919-pkz56n.rb extconf.rb
checking for cmake... no

[ERROR]: cmake is required and not installed. Get it here: http://www.cmake.org/

*** 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=/Users/nynhex/.rbenv/versions/2.4.0/bin/$(RUBY_BASE_NAME)

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/commonmarker-0.16.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/commonmarker-0.16.0 for
inspection.
Results logged to
/Users/nynhex/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/commonmarker-0.16.0/gem_make.out

An error occurred while installing commonmarker (0.16.0), and Bundler cannot continue.
Make sure that `gem install commonmarker -v '0.16.0'` succeeds before bundling.

Any thoughts on this? I'm needing this dependency for HTML pipeline for markdown parsing.

nynhex commented 7 years ago

brew install cmake fixed it.

jecyu commented 6 years ago

If the Window system should be how to deal with

jecyu commented 6 years ago

I got this problem after entering bundle update via cmder.exe (a Windows-enabled Linux terminal)

jecyu commented 6 years ago

I solved this problem by changing the Gemfile installation path for the domestic Taobao mirror source 'https://ruby.taobao.org/' gem 'github-pages', and re-run the gem install bundle, bundle install, it succeeded. This may be the reason for the wall.

cmegown commented 6 years ago

I'm currently running into this issue when running bundle update. It looks like bundler is trying to install 0.17.7 but I'm receiving the following error:

Errno::EACCES: Permission denied @ rb_file_s_symlink -
(libcmark-gfmextensions.0.28.3.gfm.11.dylib,
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.7/ext/commonmarker/cmark-upstream/build/extensions/libcmark-gfmextensions.dylib)
An error occurred while installing commonmarker (0.17.7), and Bundler cannot
continue.
Make sure that `gem install commonmarker -v '0.17.7'` succeeds before bundling.

In Gemfile:
  github-pages was resolved to 172, which depends on
    jekyll-commonmark-ghpages was resolved to 0.1.3, which depends on
      jekyll-commonmark was resolved to 1.1.0, which depends on
        commonmarker

Thoughts?

kivikakk commented 6 years ago

That's trying to do something really weird. A dylib on Windows? A build directory in cmark-upstream? None of this sounds right. Having a think.

kivikakk commented 6 years ago

Can you paste the entire build log? That might give some insight.

bluenex commented 6 years ago

@kivikakk This is what I've got on Windows 10, Ruby 2.3 x64 and the latest DevKit.

$ gem install commonmarker -v '0.17.7'
Temporarily enhancing PATH to include DevKit...
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_file_s_symlink - (libcmark-gfmextensions.0.28.3.gfm.11.dylib, C:/Ruby2
3-x64/lib/ruby/gems/2.3.0/gems/commonmarker-0.17.7/ext/commonmarker/cmark-upstream/build/extensio
ns/libcmark-gfmextensions.dylib)
fleimgruber commented 6 years ago

@kivikakk FWIW, I am seeing the same on Windows 7, ruby 2.4.2 x64 and gem 2.6.13 both installed via chocolatey from a regular cmd prompt. What is also strange here is that the folder C:\ruby does not even exist. Maybe this has something to do with the PATH meddling (MSYS/MINGW in my case and DevKit in @bluenex case). Happy to assist in testing.

> gem install commonmarker -v '0.17.7'
Temporarily enhancing PATH for MSYS/MINGW...
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied @ rb_file_s_symlink - (libcmark-gfmextensions.0.28.3.gfm.11.dylib, C:/
uby/gems/2.4.0/gems/commonmarker-0.17.7/ext/commonmarker/cmark-upstream/build/extensions/lib
s.dylib)
kivikakk commented 6 years ago

This is now #61; looking into it today and hopefully will have a resolution!

cmegown commented 6 years ago

I can confirm that 0.17.7.1 resolved this issue for me.

L5eoneill commented 6 years ago

Can attest that 0.17.7.1 does not resolve the issue: Windows 10 Pro MINGW64 terminal

Installing commonmarker 0.17.7.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.7.1/ext/commonmarker
C:/Ruby24-x64/bin/ruby.exe -r ./siteconf20180124-15324-nphr2z.rb extconf.rb
creating Makefile

current directory:
C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/commonmarker-0.17.7.1/ext/commonmarker
make "DESTDIR=" clean
'make' is not recognized as an internal or external command, operable program or batch file.`
jimkohl commented 6 years ago

Noticed that this is closed. But it shouldn't be because its still a problem on Windows (7). Getting the same errors as noted above. Github pages went to using Commonmark a while ago and this breaks updating jekyll etc. Any suggestions on how to resolve???

jimkohl commented 6 years ago

its not a permissions error that I can tell ... getting: An error occurred while installing commonmarker (0.17.9), and Bundler cannot continue. Make sure that gem install commonmarker -v '0.17.9' succeeds before bundling.

In Gemfile: github-pages was resolved to 177, which depends on jekyll-commonmark-ghpages was resolved to 0.1.5, which depends on jekyll-commonmark was resolved to 1.2.0, which depends on commonmarker

gjtorikian commented 6 years ago

@jimkohl It may be that a bundle update would fix the issue. The snippet of the error you posted seems to be an issue with version dependencies and not building issues.

jimkohl commented 6 years ago

@gjtorikian Hi.
Yep I attempted many variants ... bundle update, bundle install.
gem install make (which it did install ... but it wouldn't be found when I then did a bundle install or update).

I'm using the github pages gem which locks in various versions.
I attempted to slide back the github pages gem version but that didn't yield any great progress.
I think this is still an issue.

I used the WindowInstaller for Ruby and also MSYS2; wondering if there is a windows path issue or something? Just guessing. But it looks a lot like the above issue, hence all this.

doublewordplay commented 5 years ago

Getting the same issue on WSL. Have tried everything relevant above, still not working :/

esogeomedismo commented 5 years ago

I read this:

-   An error occurred while installing commonmarker (0.17.13), and Bundler
-   cannot continue.
-   Make sure that `gem install commonmarker -v '0.17.13' --source
-   'https://rubygems.org/'` succeeds before bundling.
PansFortress commented 5 years ago

@doublewordplay I had the same issue after setting up WSL. For me, I realized it was probably b/c I didn't have all the build tools available. I ended up grabbing build-essential which was able to resolve it for me:

sudo apt-get install build-essential