Error Installing Jekyll - Native Extension Build
Asked Answered
R

25

64

I'm having some trouble installing jekyll. Can't quite figure out how to patch the missing link. I think it's an update to Ruby, but RVM is having trouble installing alternate versions of ruby as well.

Heres the full post:

$ sudo gem install jekyll    

ERROR:  Error installing jekyll:
ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out

Does this mean I need to update the version of ruby I'm using via rvm?

Rivera answered 23/5, 2012 at 18:29 Comment(5)
What commands specifically are you running to update RVM and then switch your ruby version?Unthinkable
Hey Noah, I was trying $ rvm install ruby-1.9.2-p320Rivera
It would be helpful if you gave the exact commands you issued followed by the complete output. Try to use code highlighting too.Unthinkable
Thanks for pointing that out Noah, I added the command I issued for the jekyll install and what it output.Rivera
what does which make return?Unthinkable
U
11

Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.

You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 for lion. Or it came on a CD with your computer for earlier versions.

If you're using Lion, please see comments below for a link to how to install developer tools on Lion.

Unthinkable answered 23/5, 2012 at 20:58 Comment(9)
Great! Thanks Noah, glad to hear that's the problem. About 30 min into the install now.Rivera
I saw you're relatively new here so if my solution works you should come back and mark it as an acceptable answer so others can benefit from it.Unthinkable
Absolutely, Thanks so much for your help @NoahClark - Unfortunately though, I've installed xcode and am still getting the same issue when running the sudo gem install jekyll - I'll try and update ruby again via rvm?Rivera
running the which make command also is still coming back emptyRivera
What does typing in /usr/bin/make at the command line give you? Have you ever compiled anything for source on your system before?Unthinkable
I'm getting /usr/bin/make: No such file or directory. But I've actually just noticed something rather peculiar, My .gem .rvm .gitconfig files are are installed in the /Users/Username directory. This is actually a work computer I've not used much for dev, I am definitely fairly new to command line tools and had all of this working on my personal mac, using the work computer now I'm thinking the user settings are all jammed up. I don't think some important things are installed in the right directories.Rivera
Which means I don't think my system knows where make is located. With xcode installed it has to be there.Rivera
.gem, .rvm and .gitconfig could (and probably should) be in your home directory. That's not weird. Can you confirm that xcode is installed by running it? Are you on Lion? See: https://mcmap.net/q/269272/-using-39-make-39-on-os-xUnthinkable
Yeah, that's what I referencing from the link above! Glad you found it!Unthinkable
V
195

Ubuntu

  1. sudo apt-get install ruby-dev
  2. gem install jekyll
Vanden answered 28/7, 2012 at 9:8 Comment(8)
but it does solve my problem in Ubuntu, since the question title doesn't mention the osCalorie
OP did not mention it explicitly but the error message with the /System/Library/Frameworks was pretty revealing. Worked for me none the less on Ubuntu 13.10Venturous
This solution works on Raspberry Pi, just need add sudo for the second command: sudo gem install jekyllVines
Thank you! I had to sudo apt-get remove ruby as I had Ruby 1.9.3, and it wouldn't let me sudo gem install jekyll.Dabster
but no one says anything about Windows :(Annulment
Installing ruby dev fixed the issue. PS: For fedora: # dnf install ruby ruby-devBackstage
Same in my case, version supplied didn't match, but tried ruby-dev then worked, as usual when you miss some packages that requires compiling.Depressor
I needed sudo on both commands. Other than that: GREAT. (Unbuntu MATE 14.04)Supergalaxy
U
11

Your problem is that either you system doesn't know where make is located at or you don't have it installed. The easiest way to fix this (and probably other issues you'll run into trying to get a ruby system up and running) is to install xcode.

You can get it at http://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt=12 for lion. Or it came on a CD with your computer for earlier versions.

If you're using Lion, please see comments below for a link to how to install developer tools on Lion.

Unthinkable answered 23/5, 2012 at 20:58 Comment(9)
Great! Thanks Noah, glad to hear that's the problem. About 30 min into the install now.Rivera
I saw you're relatively new here so if my solution works you should come back and mark it as an acceptable answer so others can benefit from it.Unthinkable
Absolutely, Thanks so much for your help @NoahClark - Unfortunately though, I've installed xcode and am still getting the same issue when running the sudo gem install jekyll - I'll try and update ruby again via rvm?Rivera
running the which make command also is still coming back emptyRivera
What does typing in /usr/bin/make at the command line give you? Have you ever compiled anything for source on your system before?Unthinkable
I'm getting /usr/bin/make: No such file or directory. But I've actually just noticed something rather peculiar, My .gem .rvm .gitconfig files are are installed in the /Users/Username directory. This is actually a work computer I've not used much for dev, I am definitely fairly new to command line tools and had all of this working on my personal mac, using the work computer now I'm thinking the user settings are all jammed up. I don't think some important things are installed in the right directories.Rivera
Which means I don't think my system knows where make is located. With xcode installed it has to be there.Rivera
.gem, .rvm and .gitconfig could (and probably should) be in your home directory. That's not weird. Can you confirm that xcode is installed by running it? Are you on Lion? See: https://mcmap.net/q/269272/-using-39-make-39-on-os-xUnthinkable
Yeah, that's what I referencing from the link above! Glad you found it!Unthinkable
R
7

I had the same error on Ubuntu and this helped me sort it out.

You must have ruby-dev installed

apt-get install ruby-dev
Raze answered 10/6, 2015 at 13:41 Comment(0)
L
6

If you installed XCode and command line tools are still missing go to Terminal and

xcode-select --install

it will prompt you to install these tools. After that just follow SrBlanco´s answer. That solved the problem for me.

Good luck.

Longmire answered 7/2, 2015 at 10:14 Comment(0)
H
5

Need to install "make". I am using Ubuntu 12.10. sudo apt-get install make Should work on any Debian based distro.

Henton answered 17/2, 2013 at 4:33 Comment(0)
E
3

Note: this problem also occurs on newer MacBook Pro models that come with Mavericks pre-installed. I updated another post with my own solution that didn't involve Xcode at all. My system had the Xcode developer tools installed when I got the machine.

ERROR: Error installing jekyll: ERROR: Failed to build gem native extension

Equator answered 25/4, 2014 at 16:44 Comment(0)
P
2

Install Xcode as mentioned if you don't have it installed already (https://developer.apple.com/xcode/). Plus you need the command line tools.

Open Xcode. Go to Preferences > Downloads > Install Command Line Tools

Pipes answered 17/3, 2013 at 15:26 Comment(2)
Please don't post the same answer multiple times. Especially if you're essentially repeating what the other answers say. If you find duplicate questions, flag the so they can be merged.Mencher
I answered two questions with the same answer. Because I guess people will land on both answers. I don't know what you mean by repeating the other answers! The part with the command line tools is nowhere mentioned but an essential part of the solution. Xcode alone gets you nowhere.Pipes
C
2

Installing command line tools for Xcode solved the problem for me on my Mac

xcode-select --install.

Cabrilla answered 20/10, 2015 at 17:27 Comment(0)
M
2
  • sudo apt-get install ruby-dev
  • sudo gem install jekyll

hope this will help, it works with me.

Marchesa answered 27/11, 2016 at 9:34 Comment(0)
B
2

I followed this on Ubuntu/Linux Mint

  1. sudo apt install build-essential
  2. sudo apt install ruby-dev
  3. sudo gem install jekyll
Bryantbryanty answered 22/8, 2018 at 15:42 Comment(0)
A
1

I had this same exact error when trying to install Jekyll, and the following steps from this link helped me. Just in case anyone else comes across this!

http://davidensinger.com/2013/03/installing-jekyll/

Alemanni answered 14/2, 2014 at 17:6 Comment(0)
P
1

I was facing the same issue in my Fedora 22 setup. I had ruby installed but didn't have ruby-devel. Installing ruby-devel fixed the issue for me.

dnf install -y ruby-devel

For older systems:

yum install -y ruby-devel
Pease answered 25/12, 2015 at 12:15 Comment(0)
G
0

An addendum: You can install XCode now from the App Store on Mountain Lion. The process is transparent and pretty fast.

Gillard answered 18/2, 2013 at 20:25 Comment(0)
F
0

I had the same problems with you.

I use Mac OS X 10.9 develop preview version, and I had installed gcc and Xcode.

But my Xcode version is 4.6.

Then I install the Xcode 5.0

After that I type sudo gem install jekyll in the terminal again. Then it works.

Wish it could help someone.

Felishafelita answered 5/8, 2013 at 16:25 Comment(0)
T
0

Installing Xcode and going to perferencs > downloads > install commandline tools WORKS!

Tiloine answered 10/10, 2013 at 1:55 Comment(0)
D
0

Same problem on Debian, I had forgot to run this command:

~/.rvm/scripts/rvm
Dilate answered 26/1, 2014 at 19:5 Comment(0)
L
0

All these answers did NOT work for me.

If you're looking for a solution on ubuntu 14.04, do this:

sudo apt-get install ruby1.9.1-dev zlib1g-dev nodejs
sudo gem install jekyll -v 2.5.3

Unfortunately, nodejs is required because of a bug in Jekyll that enforces existence of runtime JS engine even though it doesn't need one.

Leverrier answered 23/3, 2016 at 22:29 Comment(0)
B
0

For Ubuntu, this helped in my case:

apt-get install libffi-dev

A general advice is to just follow what is displayed as the reason for the error and hopefully you'll be provided with a log file in which the first line suggests which package should be installed, in my case:

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

  /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/ffi-1.9.21/mkmf.log
Behring answered 11/2, 2018 at 1:54 Comment(0)
C
0

MacOS

my solution to this problem

  1. install xcode
  2. type xcode-select --install in the command line
  3. type sudo gem install jekyll in the command line

PS: It is the combination of the two answers in this question.

Cb answered 29/4, 2018 at 2:38 Comment(0)
A
0

You are missing the ruby-dev file , just go ahead and run this command - sudo apt-get install ruby-dev

Hope this helps!!

Allround answered 5/2, 2019 at 14:19 Comment(0)
C
0

I had the same issue on my macOS(10.14.2), the reason may be:

Apparently with OSX el Capitan, there is a new security function that prevents you from modifying system files called Rootless.

My solution is using rvm:

  1. install ruby on Mac OS X with RVM
  2. gem install jekyll
Christmann answered 14/2, 2019 at 3:58 Comment(0)
T
0

On windows I have this issue

I actually installed the version rubyinstaller-devkit-2.6.3-1-x64 of ruby

I have removed the ruby completely and Installed the rubyinstaller-devkit-2.5.5-1-x64

and issued the following commands on powershell

gem install bundler
gem install jekyll

and this time no errors where found

Tomtom answered 5/6, 2019 at 9:5 Comment(0)
E
0

I had this issue and of all things, the error was occurring because I hadn't agreed to some updated terms of service in xcode. Running the following did the trick for me. Go figure.

sudo xcodebuild -license accept
Eductive answered 29/9, 2019 at 2:45 Comment(0)
V
0

For me, I had to upgrade homebrew and install rbenv to the latest ruby version. After that, I followed the instruction at jekyll website. My OS is Catalina 2019, I couldn't install Xcode, which is not compatible yet!

You have to set the path in your .bash_profile to make sure that it initializes the rbenv when you restart your terminal.

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

then

$ rbenv version
2.2.3 (set by /Users/mislav/.rbenv/version)
$ rbenv shell
rbenv: no shell-specific version configured

hope that help!

Velvetvelveteen answered 11/11, 2019 at 21:9 Comment(0)
J
0

Here is the (only?) reliable and simple way to install Jekyll on macOS

  1. Install UTM
  2. Install Ubuntu Server
  3. Install Jekyll using Ubuntu instructions at https://jekyllrb.com/docs/installation/ubuntu/
  4. Forward port 22 in the VM settings (22->localhost->22)
  5. Use VS Code on the macOS host
  6. Install Remote SSH
  7. Connect to USER@localhost
  8. Drag and drop the folder on Mac into VS Code (this transfers files to remote)
  9. Enable port forwarding for 4000 (bottom bar on VS Code)
  10. Work on your website
  11. Right click on your website on the file explorer and click download

If you have not done these steps, you might be delighted by:

  1. Ubuntu imports your public SSH key from GitHub
  2. VS Code magically handles file transfer in and out
  3. VS Code magically installs your VS Code extensions onto the remote server and allows file search on the remote host
Jeggar answered 21/5, 2021 at 22:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.