Entries in problem (2)

Thursday
Nov042010

Bunder problem with a Rails gem that has generators

I ran into this problem recently so I thought I’d share.

I have a gem that I am working on. For development I use bundler and have a hard coded :path to where the gem source code is located. This allows me to develop in the context of a Rails app and have any change I make to the gem immediately available it the app. This works fine except for the generators in the gem.

With a Gemfile like this source :rubygems

gem 'rails', '2.3.10'
gem 'surveyor', :path => '/Users/brian/Rails/surveyor_for_dev'

I get “Couldn’t find ‘surveyor’ generator” when I run bundle exec script/generate surveyor from the cmd line.

If I change that line in the Gemfile and remove everything after the “gem ‘surveyor’” part, bundle install, and run the same command, everything works fine.

What I’ve had to do is use the gem for running the generators, then remove the gem from the system (or gemset) and rebundle. This way I can work on the gem despite the issue bundler is causing.

This problem has something to do with how Rails looks up generators, bundler is not providing the gem generators for local gems to Rails in the proper way.

I don’t have a good solution at this time for the problem. It’s just something to keep in mind when doing Rails gem development using bundler.

Friday
Apr302010

Problem installing git using homebrew

I finally got to the bottom of my git install issue using homebrew.

If you’re not familiar with homebrew it’s a package manager (sort of) for OS X but all the “packages” are built on your machine. It’s really a scripted installer written in Ruby. Here’s a link to a more thorough explanation: Homebrew post on EngineYard.com

Homebrew is great, and I’ve been using it for all of my new installs but I was having problems installing git. I kept getting this error using this command: sudo brew install -v git <= the ‘-v’ is for verbose output

In file included from /usr/local/include/curl/curl.h:36,
                 from http.h:6,
                 from remote-curl.c:5:
/usr/local/include/curl/curlrules.h:134: error: size of array ‘__curl_rule_01__’ is negative
make: *** [remote-curl.o] Error 1

Some backstory: I am on snow leopard but that is relatively recent. After making the transition a few weeks ago I had countless errors with the whole 32/64-bit architecture thing. What I realized in this instance was that since I had compiled curl from source when I was on leopard I needed to recompile. (I’ve had to recompile/reinstall just about everything after the upgrade (postgres, ruby, erlang, etc…)). Turns out, after downloading the latest curl, and compiling/installing it from source. I was able to install git using homebrew without a problem.

Note: I am not sure this is a git specific issue when installing with homebrew. It could be a general issue with homebrew and my system as homebrew uses curl/libcurl to get files and such. I suspect that this would have happened for any homebrew install but I have no evidence to back that up.