# Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers

**URL:** <https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206>\
**Category:** Help\
**Created:** [November 9, 2020, 6:35pm UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206 "2020-11-09T18:35:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hajsf](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/hajsf/32/2910_2.png) [@hajsf](https://talk.jekyllrb.com/u/hajsf)\
**Post date:** [November 9, 2020, 6:35pm UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206/1 "2020-11-09T18:35:29Z")

</div>

I’ve problem in installing `Jekyll` at Mac Catalina 10.15.6

```auto
Hasans-Air:hajsf.github.io hajsf$ sudo gem install -n /usr/local/bin/ jekyll
Password:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/eventmachine-1.2.7/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /Library/Ruby/Site/2.6.0 -r ./siteconf20201109-18719-18mfu7f.rb extconf.rb
checking for -lcrypto... ***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=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-ssl-dir
	--without-ssl-dir
	--with-ssl-include
	--without-ssl-include=${ssl-dir}/include
	--with-ssl-lib
	--without-ssl-lib=${ssl-dir}/lib
	--with-openssl-config
	--without-openssl-config
	--with-pkg-config
	--without-pkg-config
	--with-cryptolib
	--without-cryptolib
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:546:in `block in try_link0'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/tmpdir.rb:93:in `mktmpdir'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:543:in `try_link0'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:789:in `try_func'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1016:in `block in have_library'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:331:in `open'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
	from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/mkmf.rb:1011:in `have_library'
	from extconf.rb:8:in `block in check_libs'
	from extconf.rb:8:in `all?'
	from extconf.rb:8:in `check_libs'
	from extconf.rb:95:in `<main>'

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

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/eventmachine-1.2.7/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/eventmachine-1.2.7 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/eventmachine-1.2.7/gem_make.out

```

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [November 9, 2020, 10:30pm UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206/2 "2020-11-09T22:30:08Z")

</div>

Possibly the Xcode command-line tools aren’t installed? See:

> **[Jekyll on macOS](https://jekyllrb.com/docs/installation/macos/)**
>
> Install Command Line Tools To install the command line tools to compile native extensions, open a terminal and run:

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [November 11, 2020, 6:52am UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206/3 "2020-11-11T06:52:07Z")

</div>

Duplicate of this question about extconf.rb errors.

> [@Unable to install Jekyll on Mac OS 10.15](https://talk.jekyllrb.com/t/unable-to-install-jekyll-on-mac-os-10-15/5127):
>
> I’ve tried using all of the guides and other posts for tips on installing this, but I cannot get past these errors. I’ve installed the Xcode developer tools … but wondering, is it reference different ‘development tools’? Any tips or ideas? I’ve also checked my ruby install (running 2.6.3) and it looks fine. ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. current directory: /Library/Ruby/Gems/2.6.0/gems/eventmachine-1.2.7/ext /System/Library/…

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [November 11, 2020, 7:09am UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206/4 "2020-11-11T07:09:14Z")

</div>

Also would advice against using sudo to install _any_ gems. Its safer not to use sudo and also gems on are locked for sudo on Catalina now.

Common practice is to install Jekyll globally for the current user in `~/.gem`, not for root.  
Then you don’t need sudo and you can still run Jekyll from anywhere

Follow setup here if you want a custom Ruby.

> <https://gist.github.com/MichaelCurrin/61053a564bdb3098bae11f949bab3578>

Then start a new terminal to load your PATH.

And install Jekyll

```auto
gem install jekyll --user-install

```

```auto
jekyll --version

```

I also don’t bother with global Jekyll anymore. I switch between 3.9 and 4 for projects and so keep Jekyll in the Gemfile.  
If you do want to install Jekyll for your user, pick one that makes sense for your deploy environment. If you are locally developing to deploy on github pages, make sure to install Jekyll 3.9 when running this I think

```auto
gem install jekyll 3.9 --user-install

```

---

<div class="post-metadata">

**Author:** ![chuckhoupt](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/chuckhoupt/32/523_2.png) [@chuckhoupt](https://talk.jekyllrb.com/u/chuckhoupt)\
**Post date:** [November 11, 2020, 10:19pm UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206/5 "2020-11-11T22:19:41Z")

</div>

A side note: If one does have multiple Jekylls installed globally, then you can select them with an underscored version number (due to [Gem executable wrappers](https://guides.rubygems.org/command-reference/#description-10)). For example:

```auto
$ jekyll --version
jekyll 4.1.1
$ jekyll _3.9.0_ --version
jekyll 3.9.0

```

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [November 12, 2020, 7:48am UTC](https://talk.jekyllrb.com/t/could-not-create-makefile-due-to-some-reason-probably-lack-of-necessary-libraries-and-or-headers/5206/6 "2020-11-12T07:48:14Z")

</div>

I didn’t think it was possible to install multiple versions of a gem but it looks like it from that and the link.

An alias as `alias jekyll3='jekyll _3.9.0_'` could help.
