tags:

views:

106

answers:

1

I'm trying to use git instaweb with Ruby' webrick (which I have installed) on Mac OS X, but every time I fire up

$ git instaweb --httpd=webrick

I get the following error:

webrick not found. Install webrick or use --httpd to specify another httpd daemon.

Like I said, I do have webrick, so I don't know why git instaweb won't use it. Any ideas?

I'm using Git v1.7.2.1 on Mac OS X 10.6.

A: 

The webrick server is fairly unique in that git instaweb creates shell script named webrick in '$GIT_DIR/gitweb/', which runs '$GIT_DIR/gitweb/webrick.rb', which in turn has require 'webrick' as its first line. Check if those generated files are there, and that thye call files that exist.

'$GIT_DIR' is .git in top directory of your project, or just git rev-parse --git-dir.

Jakub Narębski
There's no `webrick` rile in `.git/gitweb`. `.git/gitweb` only contains two files: `gitweb_config.perl` and a `tmp` directory that is empty.
mipadi
Ah, I see, this is a bug in `git instaweb` introduced by 'be5347b (git-instaweb: Put httpd logs in a "$httpd_only" subdirectory, 2010-05-28)', first appearing in git version 1.7.2. This commit changed order of generating config and checking if requested web server is available, which screws things up for webrick.
Jakub Narębski