Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS X Compilation Failure #2125

Closed
zorgiepoo opened this issue Mar 11, 2014 · 19 comments
Closed

OS X Compilation Failure #2125

zorgiepoo opened this issue Mar 11, 2014 · 19 comments

Comments

@zorgiepoo
Copy link

@zorgiepoo zorgiepoo commented Mar 11, 2014

On Xcode 5.1 (clang-503.0.38) and OS X 10.9, executing "sudo gem install jekyll" gives this error:

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="
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


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/gems/fast-stemmer-1.0.2/ext/gem_make.out

Possibly related: rmagick/rmagick#96

@parkr
Copy link
Member

@parkr parkr commented Mar 12, 2014

Looks like a problem with Xcode & clang 5.1. Please ask the fast-stemmer team to help out (it's with regard to their gem)

Ref: Kapeli/cheatset#2 (comment)

@parkr parkr closed this Mar 12, 2014
@tompave
Copy link

@tompave tompave commented Mar 12, 2014

Just tried a clean install, seems to work.

$ rvm use ruby-2.1.1
Using /Users/Tom/.rvm/gems/ruby-2.1.1

$ gem install jekyll
Fetching: liquid-2.5.5.gem (100%)
Successfully installed liquid-2.5.5
Fetching: fast-stemmer-1.0.2.gem (100%)
Building native extensions.  This could take a while...
Successfully installed fast-stemmer-1.0.2
Fetching: classifier-1.3.4.gem (100%)
Successfully installed classifier-1.3.4
Fetching: rb-fsevent-0.9.4.gem (100%)
Successfully installed rb-fsevent-0.9.4
Fetching: ffi-1.9.3.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ffi-1.9.3
Fetching: rb-inotify-0.9.3.gem (100%)
Successfully installed rb-inotify-0.9.3
Fetching: rb-kqueue-0.2.2.gem (100%)
Successfully installed rb-kqueue-0.2.2
Fetching: listen-1.3.1.gem (100%)
Successfully installed listen-1.3.1
Fetching: maruku-0.7.1.gem (100%)
Successfully installed maruku-0.7.1
Fetching: posix-spawn-0.3.8.gem (100%)
Building native extensions.  This could take a while...
Successfully installed posix-spawn-0.3.8
Fetching: yajl-ruby-1.1.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed yajl-ruby-1.1.0
Fetching: pygments.rb-0.5.4.gem (100%)
Successfully installed pygments.rb-0.5.4
Fetching: highline-1.6.21.gem (100%)
Successfully installed highline-1.6.21
Fetching: commander-4.1.6.gem (100%)
Successfully installed commander-4.1.6
Fetching: safe_yaml-0.9.7.gem (100%)
Successfully installed safe_yaml-0.9.7
Fetching: colorator-0.1.gem (100%)
Successfully installed colorator-0.1
Fetching: redcarpet-2.3.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed redcarpet-2.3.0
Fetching: blankslate-2.1.2.4.gem (100%)
Successfully installed blankslate-2.1.2.4
Fetching: parslet-1.5.0.gem (100%)
Successfully installed parslet-1.5.0
Fetching: toml-0.1.1.gem (100%)
Successfully installed toml-0.1.1
Fetching: jekyll-1.4.3.gem (100%)
Successfully installed jekyll-1.4.3
21 gems installed

My system is OS X 10.9.2, with Xcode 5.1

$ which clang
/usr/bin/clang

$ ls -l /usr/bin/clang
-rwxr-xr-x  1 root  wheel    14K 26 Oct 18:38 /usr/bin/clang*

 $ clang --version
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
@Kapeli
Copy link

@Kapeli Kapeli commented Mar 12, 2014

@tompave it works fine with Ruby 2.1.1, but fails with the system-default Ruby (which is 2.0.something)

@nghuuphuoc
Copy link

@nghuuphuoc nghuuphuoc commented Mar 18, 2014

Thanks @tompave
It worked for me too 👍

@thepatrick
Copy link

@thepatrick thepatrick commented Mar 22, 2014

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

Works around this issue for me

@ghost
Copy link

@ghost ghost commented Mar 28, 2014

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

This works for me too!

@manmadewind
Copy link

@manmadewind manmadewind commented Mar 28, 2014

@thepatrick, Thank you! That worked for me!

@liuyu121
Copy link

@liuyu121 liuyu121 commented Mar 30, 2014

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

Yeah, great job. So Thanks. @thepatrick

But anyone can explain it ?

@liuyu121
Copy link

@liuyu121 liuyu121 commented Mar 31, 2014

And may be must use the SUDO do it .

This is a link from the APPLE SITE

https://developer.apple.com/library/ios/releasenotes/developertools/rn-xcode/Introduction/Introduction.html

@santanastasios
Copy link

@santanastasios santanastasios commented Apr 11, 2014

I think it is caused by defaults that mkmf brings in (as I've had other occurrences of the same error), and probably there is too little motivation to "fix" it when all people will want to do is to use Ruby 2.1 and higher.

@linus-young
Copy link

@linus-young linus-young commented Apr 18, 2014

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

works for me too!
ps: I'm using OS X 10.9.2 & ruby 2.0.0p247 & clang 5.1

@michaeljdeeb
Copy link

@michaeljdeeb michaeljdeeb commented Apr 18, 2014

When using the workaround @linus-young, were you able to successfully run jekyll serve --watch on a folder? I ran into issues where it was trying to execute from within the iOS Simulator directory.

Using Ruby 2.1 via RVM solved my issue.

@linus-young
Copy link

@linus-young linus-young commented Apr 18, 2014

@michaeljdeeb I edit a file in _site folder, and in terminal it displayed Regenerating : 1 files .... done , then in browser it worked.

@jaybe-jekyll
Copy link
Member

@jaybe-jekyll jaybe-jekyll commented Apr 23, 2014

For those purists, that, for whatever their masochistic reasons (myself included), wish not to employ sudo, rbenv, homebrew, or otherwise, and wish to remain user-locally, within their native OSX environment, the following works, for now, until fast stemmer is rectified, on a clean Mavericks installation:

  • ensure ~/bin exists; e.g. mkdir ~/bin
export PATH=$PATH:~/bin ; ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install jekyll --no-document --user-install --verbose --bindir ~/bin
  • For availability and persistence of binaries in ~/bin, consider permanently adding ~/bin to your $path via however you normally do that; usually ~/bash_profile, etc.
$ cd ~

$ which jekyll
/Users/jaybe-jekyll/bin/jekyll

$ jekyll new whee
New jekyll site installed in /Users/jaybe-jekyll/whee.
@kevinpapst
Copy link

@kevinpapst kevinpapst commented Apr 25, 2014

Thanks @jaybe-jekyll, your solution worked for me.

@jaybe-jekyll
Copy link
Member

@jaybe-jekyll jaybe-jekyll commented Apr 25, 2014

@kevinpapst, you are welcome; and thank you for reporting and sharing your success.

As an added bonus and effort in proactivity, safety, and stability, please also consider the following:

Upgrading/Updating Jekyll

  • Same as installation approach but with slight gem command line modification: update
    • ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem update jekyll --no-document --user-install --verbose --bindir ~/bin
      • (difference: s/install/update/)

Generally-major Gotcha'

  • It is generally unwise and dangerous to ever contemplate doing the following on a standard OSX installation, and generally- also within Linux, when behaving as a purist with Ruby (or Python) outside of using an environment manager such as rbenv, rvm, etc.:
    • sudo gem update --system <-- masochism
    • sudo gem update <-- masochism
  • Doing that on an OSX/Linux system will introduce pain and entropy into a stable and managed system, purposely interjecting and overwriting the system' interests.

An (likely silly) analogy is documenting a recipe by hand on a recipe card. Instead of getting your own card, and writing it down- just for you- and keeping it in your own box, you go out and replace everyones recipe card with your recipe and force everyone and everything to use only your recipe. Eventually, someone is going to want their gumbo recipe back, and they'll throw a fit when they don't get what they expected.

Ensuring Understanding of User-space Approach

  • The purist approach of installing gems within user-space is not new or revolutionary.
  • Ruby environment managers such as rbenv, rvm, etc. perform similar functions, albeit more advanced and flexible, and manageable, generally for developers and tinkerers.
    • For the basic, average, non-developing user, that simply wishes to have, run, use, and update a gem (jekyll), and continue using the system' ruby, this approach is effective.

We are basically just telling gem, ...

Please install jekyll, via gem, but do it within my user space (--user-install) ...
... so the backend code and dependencies get installed to my home directory (~) in, i.e. ~/.gem/ruby/2.0.0/..., ...
... and the binaries that get run, such as jekyll, redcarpet, etc. are installed in my binary directory (--bindir ~/bin) within my home directory, instead of the system', at ~/bin/jekyll, ~/bin/redcarpet, ..., etc.

So, in General... choices...

  • $ gem install jekyll --user-install --bindir ~/bin, or...
  • $ gem install jekyll --user-install --bindir ~/bin --no-document, or...
  • $ gem install jekyll --user-install --bindir ~/bin --no-document --verbose, or...
  • $ gem update jekyll --user-install --bindir ~/bin ... ... etc.
@shaoweiD
Copy link

@shaoweiD shaoweiD commented Apr 27, 2014

Ruby 2.1 solves it!!!!!!!!!!!!thanks a lot

@shaoweiD
Copy link

@shaoweiD shaoweiD commented Apr 27, 2014

thanks @tompave

@fengs
Copy link

@fengs fengs commented Feb 12, 2015

Upgrading ruby to 2.1.5 solves this. Thanks.

@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet