7

I sucessfully installed Ruby, version 1.8.7 and have been trying to install Jekyll in the Terminal using sudo gem install jekyll. Here's the error I get:

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /Library/Ruby/Gems/1.8 directory. unknown68a86d3f981e:~ srb_1974$ sudo gem install jekyll Building native extensions. This could take a while... 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

I've read a bunch of topics, but can't get anything to work. Many topics say I have to have XCode first, but it won't even download, much less install. I read that in Lion you have to set up another administrator and install it under that profile, so I did that, but the install package doesn't exist. It won't even download. I think this may be because I'm not a registered Apple Developer?

Another recommendation was that I install Ruby RVM - this also won't install. Here's the command I used: bash < <( curl https://rvm.beginrescueend.com/releases/rvm-install-head )

And here's the error I get:

% Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle" of Certificate Authority (CA) public keys (CA certs). If the default bundle file isn't adequate, you can specify an alternate file using the --cacert option. If this HTTPS server uses a certificate signed by a CA represented in the bundle, the certificate verification probably failed due to a problem with the certificate (it might be expired, or the name might not match the domain name in the URL). If you'd like to turn off curl's verification of the certificate, use the -k (or --insecure) option. unknown68a86d3f981e:~ srb_1974$

I only care about Ruby RVM and XCode to the extent that I need them to install Jekyll. I'm just trying to get my Github blog going and I can't seem to do it. I've read and read and read documentation and there's something I'm missing. I'm pretty sure it's knowledge everyone's assuming I have - I don't. I'm a beginner programmer. Any help would be much appreciated.

Stacey Baker
  • 229
  • 3
  • 11

4 Answers4

9

Ok, here's how I got it to work. It was kind of a random experimentation process until something worked.

I installed XCode and Ruby RVM per others' suggestions and the latter led to my resolution. One of the suggestions on this page said to run "rvm requirements" and read the text. It basically tells you what you need to run & upgrade rubies. This documentation was quite helpful. It explained that what I needed to install Jekyll wasn't really XCode - it was GCC. Evidently, older versions of XCode came with GCC, but newer versions do not, which is why installing XCode didn't solve my problem. It also directed me to where I could download & install GCC, warning me that installing GCC over a newer version of XCode is known to cause problems. So, I uninstalled XCode & headed over here to install GCC.

It was that simple - I installed GCC and Jekyll installed in seconds.

Stacey Baker
  • 229
  • 3
  • 11
0

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

So the error is "Failed to build gem native extension." when you run sudo gem install jekyll command. You'll find a tip in Jekyll Wiki's Install section:

If you encounter errors like Failed to build gem native extension on Windows you may ... On OSX, you may need to update RubyGems:

$ sudo gem update --system

So, try to update your RubyGems and run sudo gem install jekyll after that. And I think you don't need to install ruby rvm if you're not a ruby developer.

Btw, I think Ruby v1.9.1 is a recommended version.


And for your Xcode related question, you can download it from App Store though you're not a registered Apple developer. It's free.
Xcode is useful when you need to build some libs with gcc (gcc will be installed together after you've installed the Xcode). But I've no idea whether you'll need it when you install the jekyll.

Kjuly
  • 34,476
  • 22
  • 104
  • 118
  • Hi Kjuly, thanks for responding. I had already checked the version using "Ruby -v" and "sudo gem update --system" and "update_rubygems" and "sudo gem install rubygems-update" and "gem install rubygems-update" and "sudo apt-get install ruby1.9.1-dev" but I went ahead and tried "sudo gem update --system" again so that I could find the message that returns. It returns this: "Latest version currently installed. Aborting." Ideas? – Stacey Baker Jul 13 '12 at 02:06
  • @StaceyBaker then you can try to run `sudo gem install jekyll`. – Kjuly Jul 13 '12 at 02:44
  • Kjuly - I did. And it gives me the error in my original post. – Stacey Baker Jul 13 '12 at 18:35
  • @StaceyBaker have you installed Xcode? It might be necessary to build gem native extension (which need gcc to build). – Kjuly Jul 14 '12 at 00:04
  • Yes, I was able to successfully install XCode and Ruby RVM. I tried running sudo gem install jekyll two more times - one with XCode open, and once with it closed. Both times I got the same error: – Stacey Baker Jul 15 '12 at 07:55
  • 2
    I finally got it to work - I found the answer with the command 'rvm requirements', which printed the requirements to install ruby products in Terminal. I had to uninstall XCode and install GCC here: https://github.com/kennethreitz/osx-gcc-installer. Then jekyll installed fine. – Stacey Baker Jul 15 '12 at 08:28
  • 1
    @StaceyBaker - Welcome to Stack Overflow. Glad you figured it out. If you post your own answer describing what you did and accept it, that will make it easier for others to find. It's [perfectly acceptable to do so](http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/). – Alan W. Smith Jul 15 '12 at 12:53
  • 1
    @Kjuly - I did have to uninstall XCode. The rvm requirements text said that installing GCC over newer versions of XCode is known to cause problems, so they recommended uninstalling it before installing GCC. Another note - the text also said that older versions of XCode have GCC, which is why installing XCode is recommended, but newer versions do not have it so this is no longer a solution to the problem. – Stacey Baker Jul 16 '12 at 01:42
  • @StaceyBaker I see.. You're right, it seems Xcode uses LLVM instead now. – Kjuly Jul 16 '12 at 04:08
0

I tried all the solutions above and did not work. I posted my answer here originally:

RVM requirements error

but for brevity, this is what I posted:

It seems that on OSX 10.9 and XCode5 moved some libs around on us. So I had to install XCode5-DP6 (Dev Preview 6), opened up DP6 and in the settings, you have to tell the command line tools to use the new DP6 build and not the Standard XCode from the marketplace.

First, I had to install homebrew. Nothing liked to play with macports. I am on my first mac as of only a month ago, so macports was just what solved apache for me at the time. I then had to run 'brew install autoconf'

Once I did that I then ran rvm requirements, everything installed without issue. then sudo gem install jekyll from there and it all works like a charm now.

I'm sure once Mavericks is actually released this will get ironed out. We are using early releases after all...

Community
  • 1
  • 1
skift
  • 1,027
  • 2
  • 16
  • 27
0

Same issue encountered! After reading this article and random experimentation like following,

fixed the issue and could successfully install jekyll