BUT, I'd like to generate the eBook myself, if'n it ain't too complicated. :) |
I did it using WSL on my Windows machine. When I started this I had already downloaded the book's sources into
d:/progit2 using Github's web GUI. Then in a
cmd.exe instance I ran the command
wsl to get a Bash prompt. Note that WSL makes the contents of drive
d accessible via the directory ("mount point") called
/mnt/d, so I just said
cd /mnt/d/progit2 to get started.
Following the instructions you linked, I first tried to execute
bundle install but
bundle was missing. The error suggested I install
ruby-bundler, which helped, but I still could have found the right package via
https://packages.ubuntu.com/.
I installed it per the error message. Remember to update the system first:
$ sudo apt update
$ sudo apt upgrade
$ sudo apt install ruby-bundler |
When I ran
bundle install again I was told that a compatible version of
ruby was missing. I'd expect that a package called
ruby-bundler would have installed
ruby as a dependency, but to make sure I said
$ sudo apt install ruby
I could have chosen a less-intrusive way to check whether it was installed. But now it's definitely installed and its version is 2.7.0. This is outdated according to
bundle from above, so I had to build a newer version from source.
From
https://www.ruby-lang.org/en/downloads/ I downloaded the stable version 3.2.2 to the root of my
d: drive and uncompressed it:
$ cd /mnt/d/; tar zxf ruby-3.2.2.tar.gz; cd ruby-3.2.2
The relevant instructions are in
doc/contributing/building-ruby.md
I installed all the dependencies, to be safe:
$ sudo apt install gcc autoconf bison gperf libssl-dev libedit-dev libz-dev libffi-dev libyaml-dev
Note that Ruby 2.7 is a required dependency of Ruby 3.2.2, but I just installed that.
Then I generated the configure script
$ ./autogen.sh
Made a build directory and ran the generated code:
$ mkdir -p build; cd build; ../configure --prefix=/usr/local
Then I built it as my normal user (20 minutes). Building in parallel did not work for me.
$ make
I ran tests:
$ make check
And installed the program (5 minutes)
$ sudo make install
This process created conflicts between the manually-installed
ruby 3.2.2 and the junk from the package manager. I removed the packaged stuff as follows.
$ sudo apt remove ruby-bundler ruby;
$ sudo apt autoremove |
Then I could make the book:
$ cd /mnt/d/progit2
Because I installed into
/usr/local the
bundle install needed root:
$ sudo bundle install
Then finally:
$ bundle exec rake book:build
Thanks for pointing me to the book!