Fellowship Hacks ยป Webgen

Webgen

Introduction

Webgen is a nice Ruby utility to generate a website starting from source files written in different markup languages.

The current development version (0.5.x) is not yet packaged for most GNU/Linux distros, so here you are some instructions to install it on a Debian Etch system.

Webgen 0.5.6 on Debian Etch

Warning

Installing webgen 0.5.6 following the instructions below will render any webgen 0.4.x Debian package unusable, at least in my experience.

So far, I've not been able to have both webgen 0.5.6 and webgen 0.4.x running on the same system.

After the installation procedure described below, if I try to run the /usr/bin/webgen executable (Debian Lenny package, otherwise running fine on Debian Etch), I get the error:

    /usr/local/lib/site_ruby/1.8/webgen/cli.rb:1:in
        `require': no such file to load -- cmdparse (LoadError)

Adding export RUBYOPT=rubygems to ~/.bashrc doesn't resolve; I get another kind of error:

  /usr/bin/webgen:4: undefined method `cli_main' for Webgen:Module (NoMethodError)

So, please don't proceed if you need to keep a working webgen 0.4.x version on your system.

1. Install basic Ruby packages

There are no webgen backports for Debian Etch, so we have to install it from the Ruby sources; anyway, some basic Ruby packages can be installed as standard Debian packages.

aptitude install ruby1.8 libredcloth-ruby rubygems

(maybe something more)

Note: if you are on a Sun sparc platform, the current ruby packages are bugged: use the etch-backports packages instead: see http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=393817

2. Install webgen dependencies

Dependencies are listed at http://webgen.rubyforge.org/

  • facets: not packaged for debian! See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=307078 and http://pkg-ruby-extras.alioth.debian.org/

    • The required package is available only in .gem format; see http://facets.rubyforge.org/download.xml and http://rubyforge.org/frs/?group_id=804

    • gem is Ruby's "rpm", the "gem" command is provided by the rubygems Debian package (http://www.rubygems.org)

    • rubygem has a nasty bug when trying installing packages remotely (=downloading packages from the ruby remote repository): first it tries to update the local index of the repository, but this operation takes ages, and sometimes eats all the system memory: your system gets stuck with the message: "Bulk updating Gem source index"

    • So, the suggested way to install gem packages is to download each package manually (from rubyforge.org) and install it with the gem --local command (the argument must be the name of the package, complete with version information):

          gem install --local facets-2.5.0
  • cmdparse: already installed on Etch, but installing webgen as a gem doesn't recognize it, so I installed cmdparse too as a gem package
      gem install --local cmdparse-2.0.2
  • maruku: there's a package for Lenny (libmaruku-ruby1.8) installable on Etch. If webgen doesn't recognise it, you will have to install this too as a gem package:
      gem install --local syntax-1.0.0
      gem install --local maruku-0.5.9

3. Install webgen

There are two package types at http://rubyforge.org/frs/?group_id=296, .gem packages and .tgz packages.

I tried installing the .gem package, but ran into dependency problems, so I downloaded the tgz package and compiled it.

Before proceeding, we need to install the rake utility

gem install --local rake-0.8.3

To compile and install webgen:

  cd sources
  ruby setup.rb config --prefix /usr/local
  ruby setup.rb setup
  ruby setup.rb install

4. Test the sample site creation

See: http://webgen.rubyforge.org/documentation/0.5.x/getting_started.html

Run

webgen create sample_site

If you get this kind of error...

  /usr/local/lib/site_ruby/1.8/webgen/cli.rb:1:in
  `require': no such file to load -- cmdparse (LoadError)

...you have to put this in ~/.bashrc

  export RUBYOPT=rubygems