Pregunta

Trying to install stable version of Jekyll on OSX Mavericks. I have Xcode and the command line tools installed, yet I get this error:


sudo gem install jekyll
Password:
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/2.0/usr/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling porter.c
porter.c:359:27: warning: '&&' within '||' [-Wlogical-op-parentheses]
      if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
                ~~ ~~~~~~~^~~~~~~~~~~~~~~~~~~~
porter.c:359:27: note: place parentheses around the '&&' expression to silence this warning
      if (a > 1 || a == 1 && !cvc(z, z->k - 1)) z->k--;
                          ^
                   (                          )
1 warning generated.
compiling porter_wrap.c
linking shared-object stemmer.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [stemmer.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/fast-stemmer-1.0.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/fast-stemmer-1.0.2/gem_make.out
¿Fue útil?

Solución

Your problem appeared with Xcode 5.1. In order to avoid many problems related to MacOS' ruby version (this one and many others), you really should use RVM.

If you don't already have it, install Homebrew first: (it is not absolutely necessary, but allows us to install ruby and its dependencies without a looong compilation)

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Then, the following command will install RVM and the last version of Ruby:

\curl -L https://get.rvm.io | bash -s stable --ruby

Check everything is OK:

ruby --version

You can now install Jekyll:

gem install jekyll

Now, if you really don't want to use RVM, you can execute:

sudo ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll

But I bet further problems would come.

Otros consejos

You should definitely use RVM. Here are the steps:

  1. Uninstall any existing XCode by deleting XCode from Applications folder.
  2. Install Homebrew.

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    
  3. Follow additional instructions listed in Homebrew install.

    brew doctor
    
  4. Install RVM.

    \curl -L https://get.rvm.io | bash -s stable --ruby
    
  5. Follow additional instructions upon RVM installation.

    source ~/.rvm/scripts/rvm
    
  6. Install jekyll.

    gem install jekyll
    
  7. Test jekyll.

    $ jekyll serve
    
    Configuration file: none
    
            Source: /private/var/log
    
       Destination: /private/var/log/_site
    
      Generating... done.
    
    Server address: ...
    
    Server running... press ctrl-c to stop.
    

1) xcode-select --install

2) brew install ruby

3) sudo gem install jekyll

4) sudo gem install jekyll-import

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top