TechDocs/FellowshipHacks/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/

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

TechDocs/FellowshipHacks/Webgen (last edited 2016-03-21 17:51:02 by paul)