Category Archives: brew

Fixing emacs install path

I’ve recently switched from macports to brew. Things that were previously installed using macports were not working properly. For example emacs,

$brew list emacs

Returned the following:

/usr/local/Cellar/emacs/24.4/bin/ebrowse
/usr/local/Cellar/emacs/24.4/bin/emacs
/usr/local/Cellar/emacs/24.4/bin/emacs-24.4
/usr/local/Cellar/emacs/24.4/bin/emacsclient
/usr/local/Cellar/emacs/24.4/bin/etags
/usr/local/Cellar/emacs/24.4/bin/grep-changelog
/usr/local/Cellar/emacs/24.4/homebrew.mxcl.emacs.plist
/usr/local/Cellar/emacs/24.4/libexec/emacs/ (5 files)
/usr/local/Cellar/emacs/24.4/share/applications/emacs.desktop
/usr/local/Cellar/emacs/24.4/share/emacs/ (3822 files)
/usr/local/Cellar/emacs/24.4/share/icons/ (7 files)
/usr/local/Cellar/emacs/24.4/share/info/ (62 files)
/usr/local/Cellar/emacs/24.4/share/man/ (5 files)
/usr/local/Cellar/emacs/24.4/var/games/ (2 files)

But emacs, linked to /usr/local/bin/emacs was not linked to /usr/local/Cellar/emacs/24.4/bin/emacs

The fix was running

$brew link emacs

But before that I had to fix permissions to /usr/local/share/emacs which was set by macports: http://stackoverflow.com/questions/16844826/error-when-trying-to-brew-link-autoconf

Advertisements

[Ruby] Fixing: “Cannot load such file — hitimes/hitimes” when installing jekyll

I was getting the above error and the only page I could find was https://github.com/copiousfreetime/hitimes/issues/17 which doesn’t look related.

Context: I was trying to follow [1] and run jekyll on my local machine. When running bundle exec jekyll serve I got a stacktrace with the message:

Cannot load such file — hitimes/hitimes

I’m on a MacOS ans installed ruby using brew. The problem is that I had a native ruby installation and also remains from a previous mac port install. The fix was quite simple. First, how I got to a messed up stage:

I had a version of ruby running, but even when installed the newest version using brew, the versions were not matching:

ruby -v

Then I decided to override the PATH variable to find the brew installation first. For that we need to know where that is located:


$brew ls ruby
...
/usr/local/Cellar/ruby/2.1.5/bin/ruby

I also n00b’ed and hard-coded the /usr/local/Cellar/ruby/2.1.5/bin/ in the PATH env variable. But by default, brew will create a soft link to

/usr/local/opt/ruby

But my directories were messed up (maybe because I was using macports before) and so the link was not created. To fix that, I had to run:

brew link --overwrite ruby

After fixing the symlink, I updated my path to include /usr/local/opt and this fixed the issue.

References

[1] https://help.github.com/articles/using-jekyll-with-pages/
[2] http://stackoverflow.com/questions/6482738/installing-ruby-gems-not-working-with-home-brew