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

Github for Mac not Triggering Lolcommits #159

Closed
ghost opened this issue Sep 22, 2013 · 20 comments
Closed

Github for Mac not Triggering Lolcommits #159

ghost opened this issue Sep 22, 2013 · 20 comments
Assignees
Labels

Comments

@ghost
Copy link

ghost commented Sep 22, 2013

I just installed lolcommits (version 0.5.0) and it only seems to work when the Mac GUI is launched via the command line. I'm using the version of Ruby bundled with OS X - ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0].

@ghost
Copy link
Author

ghost commented Sep 23, 2013

I just tried installing lolcommits to the RVM gemset using the latest version of Ruby, and nothing changed.

@ruippeixotog
Copy link

Try modifying the post-commit hook to something like:

#!/usr/bin/env bash
export LANG=en_US.UTF-8
export PATH=$PATH:/usr/local/bin

source $HOME/.bashrc

lolcommits --capture

@matthutchinson
Copy link
Member

Re-opening after GitHub weirdness

@sebald
Copy link

sebald commented Feb 10, 2014

Does anyone have a solution for this?

When I use the command line lolcommits works. But if I use Github's GUI Client it doesn't :(

@matthutchinson
Copy link
Member

Now fixed in gem release 0.5.5! (see the CHANGELOG for more details)

gem install lolcommits to get the latest version 👍

@matthutchinson
Copy link
Member

NOTE: After installing the latest version you'll need to lolcommits --disable and then lolcommits --enable again to fix any existing hook already set from an earlier gem install.

If lolcommits --disable fails to remove the hook, try blowing away /path/to/your/repo/.git/hooks/post-commit (or editing that file manually to clean away any existing lolcommit applied hook before trying to enable again).

@sebald
Copy link

sebald commented Sep 30, 2014

I still get the following error :(

dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /usr/local/bin/mogrify
  Reason: image not found
/Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick.rb:36:in `image_magick_version': undefined method `split' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick.rb:54:in `valid_version_installed?'
    from /Library/Ruby/Gems/2.0.0/gems/lolcommits-0.5.5/lib/lolcommits/configuration.rb:200:in `valid_imagemagick_installed?'
    from /Library/Ruby/Gems/2.0.0/gems/lolcommits-0.5.5/bin/lolcommits:44:in `die_on_fatal_conditions!'
    from /Library/Ruby/Gems/2.0.0/gems/lolcommits-0.5.5/bin/lolcommits:362:in `<top (required)>'
    from /usr/bin/lolcommits:23:in `load'
    from /usr/bin/lolcommits:23:in `<main>'

Is there a problem with my Ruby path?

@matthutchinson
Copy link
Member

That error is raised from valid_imagemagick_installed? so I suspect you either don't have imagemagick installed or something is up with your path to the imagemagick convert and identify commands.

Can you brew install imagemagick (or re-install it) then try this in console;

which convert
which identify

m

@matthutchinson
Copy link
Member

Also, check your lolcommits hook in /path/to/your/repo/.git/hooks/post-commit - it should have an export PATH that includes the path for your Ruby and to imagemagick commands.

@sebald
Copy link

sebald commented Sep 30, 2014

Thx for the quick reply!!!

I already re-installted imagemagick but it didn't help :-/
Here is the ouput:

/usr/local/bin/convert
/usr/local/bin/identify

Contents of the hook:

#!/bin/sh
### lolcommits hook (begin) ###
export PATH="/usr/bin:/usr/local/bin:$PATH"
lolcommits --capture
###  lolcommits hook (end)  ###

The path to my Ruby is /usr/bin/ruby

@matthutchinson
Copy link
Member

Ok, really want to get to the bottom of this, can you answer a few more questions;

  • Judging by that PATH for Ruby - Is this your default OSX system ruby?
  • Did you gem install lolcommits with sudo?
  • How did you install imagemagick? (with homebrew? macports? something else?)
  • What OSX version are your running (check 'About this Mac' from Apple icon on top left main menu)
  • On the command line from your repo - try the following and paste the full output - lolcommits --capture --test --debug

@matthutchinson
Copy link
Member

Finally, try these in a console a tell me what they give you;

  • mogrify --version
  • ruby -e 'puts mogrify --version.split(" ")[2].split("-").first'

You need mogrify --version to report an ImageMagick install with >= 6.6.3 e.g. something like this as the first line;

Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-08-31 http://www.imagemagick.org

@matthutchinson
Copy link
Member

🔔 @sebald ping 🔔

@sebald
Copy link

sebald commented Oct 1, 2014

  • Yes
  • Yes
  • Homebrew
  • 10.9.5
$ lolcommits --capture --test --debug
Outputting at DEBUG verbosity
dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /usr/local/bin/mogrify
  Reason: image not found
/Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick.rb:36:in `image_magick_version': undefined method `split' for nil:NilClass (NoMethodError)
    from /Library/Ruby/Gems/2.0.0/gems/mini_magick-3.8.1/lib/mini_magick.rb:54:in `valid_version_installed?'
    from /Library/Ruby/Gems/2.0.0/gems/lolcommits-0.5.5/lib/lolcommits/configuration.rb:200:in `valid_imagemagick_installed?'
    from /Library/Ruby/Gems/2.0.0/gems/lolcommits-0.5.5/bin/lolcommits:44:in `die_on_fatal_conditions!'
    from /Library/Ruby/Gems/2.0.0/gems/lolcommits-0.5.5/bin/lolcommits:362:in `<top (required)>'
    from /usr/bin/lolcommits:23:in `load'
    from /usr/bin/lolcommits:23:in `<main>'

@sebald
Copy link

sebald commented Oct 1, 2014

Sorry @matthutchinson had a meeting today... :-)

$ mogrify --version
dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /usr/local/bin/mogrify
  Reason: image not found
Trace/BPT trap: 5
$ ruby -e 'puts mogrify --version.split(" ")[2].split("-").first'
-e:1:in `<main>': undefined local variable or method `version' for main:Object (NameError)

Throw an error.

@matthutchinson
Copy link
Member

Bingo, your ImageMagick install is broken, particularly the mogrify command working with the freetype library. This isn't a problem with lolcommits or GitHub for Mac. You need to get the mogrify --version command (an ImageMagick command) to work properly so that it returns the ImageMagick version with the first line something like this;

Version: ImageMagick 6.8.9-7 Q16 x86_64 2014-08-31 http://www.imagemagick.org

The first thing I'd try would be;

brew uninstall imagemagick
brew uninstall freetype
brew install imagemagick
brew install freetype
brew unlink freetype && brew link freetype

Failing that -- google around for that error, or try the following links;

I'll leave the issue open until you have it sorted, we should update the error message around this check to explain something is up with your ImageMagick install!

@sebald
Copy link

sebald commented Oct 1, 2014

I already did search for a solution and found this thread here
Homebrew/legacy-homebrew#6891
But nothing seems to work :-/

I know that the linking has to be messed up, but I have no clue how to fix that.

@matthutchinson
Copy link
Member

OK, i'll close this issue when I've implemented a better error message in lolcommits for this. For the error, i'd keep googling, I bet someone has had the same issue; e.g. here

@matthutchinson
Copy link
Member

Created the PR for this, that explains the error better, closing issue for now.

@edorgeville
Copy link

brew uninstall libtool
brew install libtool --universal

Fixed it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants