git-up icon indicating copy to clipboard operation
git-up copied to clipboard

git-up not working on OS X Mavericks

Open bedge opened this issue 11 years ago • 13 comments

Using the basic instructions, it seems to install OK:

%> sudo gem install git-up Fetching: git-up-0.5.12.gem (100%) Successfully installed git-up-0.5.12 Parsing documentation for git-up-0.5.12 Installing ri documentation for git-up-0.5.12 Done installing documentation for git-up after 0 seconds 1 gem installed

However it is not functional:

%> git up git: 'up' is not a git command. See 'git --help'.

Did you mean one of these? pull push

I'm setup with homebrew git that's found first before os x git: %> for g in $(which -a git) ; $g --version git version 1.9.0 git version 1.8.5.2 (Apple Git-48)

Not sure what to provide, not a ruby guy.

%> gem list

*** LOCAL GEMS ***

bigdecimal (1.2.5, 1.2.4) colored (1.2) diff-lcs (1.2.5) git-up (0.5.12) grit (2.5.0) io-console (0.4.2) json (1.8.1) mime-types (2.2, 1.25.1) minitest (5.3.1, 4.7.5) posix-spawn (0.3.8) psych (2.0.4, 2.0.3) rake (10.1.1, 10.1.0) rdoc (4.1.1, 4.1.0) test-unit (2.5.5, 2.1.1.0)

%> gem --version 2.2.2

bedge avatar Mar 21 '14 15:03 bedge

I tracked down the actual binary, and that does work when invoked directly:

%> /usr/local/lib/ruby/gems/2.1.0/gems/git-up-0.5.12/bin/git-up Fetching origin ...

So, the issue then is, what maps "git up" to the above binary?

bedge avatar Mar 21 '14 16:03 bedge

It works for me with the default ruby installation. I think that you are using a custom ruby, because the versions don't match. Mine is ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13] while yours seems to be Version 2.1.

Is it possible that the gem binary path is not in your PATH?

rsobik avatar Mar 23 '14 10:03 rsobik

I was able to install git-up on my machine because the dependencies that require building a native extension were already installed.

Check out https://github.com/headius/ruby-atomic/issues/43#issuecomment-38201002 that provides a fix for this issue.

rsobik avatar Apr 01 '14 12:04 rsobik

I'm also having issues:

Building native extensions.  This could take a while...
ERROR:  Error installing git-up:
    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 posix-spawn.c
In file included from posix-spawn.c:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby.h:33:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/ruby/ruby.h:24:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0/universal-darwin13/ruby/config.h:17:9: warning: '_GNU_SOURCE' macro redefined
#define _GNU_SOURCE 1
        ^
posix-spawn.c:3:9: note: previous definition is here
#define _GNU_SOURCE
        ^
1 warning generated.
linking shared-object posix_spawn_ext.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: *** [posix_spawn_ext.bundle] Error 1


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/posix-spawn-0.3.8 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/posix-spawn-0.3.8/ext/gem_make.out
FAIL: 1

marcoscaceres avatar Apr 14 '14 18:04 marcoscaceres

I'm having the same issue as @marcoscaceres

sjmarshy avatar Apr 16 '14 08:04 sjmarshy

@sjmarshy, this worked for me:

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

marcoscaceres avatar Apr 16 '14 13:04 marcoscaceres

@marcoscaceres' solution worked for me, also.

kitt avatar Jul 03 '14 18:07 kitt

I was having the same issue as @bedge. Solved it using rvm to install ruby on my Mac and switch to the global gemset:

curl -sSL https://get.rvm.io | bash -s stable --ruby
rvm --default use ruby-2.1.2
gem update --system
gem update
rvm gemset use global

Then added the ruby gems path to the shell PATH:

PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH"

And finally installed with gem install git-up (no admin privileges needed).

asmod3us avatar Jul 28 '14 19:07 asmod3us

Thank you @asmod3us! Worked for me on OSX Yosemite Beta... I just used rvm --default use ruby-2.1.3 instead since that was the most current version as of this post :heart:

saada avatar Sep 24 '14 19:09 saada

If you are running rbenv, you'll need to run rbenv rehash after installing executable gems, so it can symlink its shims.

nemoDreamer avatar Oct 13 '14 15:10 nemoDreamer

@nemoDreamer thank you. That did it for me.

dvdchr avatar Nov 21 '14 15:11 dvdchr

@asmod3us That worked for me! It was a headache before I found this post. Thanks!

mrtrom avatar Dec 08 '14 03:12 mrtrom

@asmod3us nice trick. Used rvm info to figure out which ruby version to use with the rvm --default use command.

ronanguilloux avatar Oct 31 '15 09:10 ronanguilloux