Software Development |
Ruby on Rails
Installing altered_beast on Windows
Having failed at getting adva-cms working I thought I'd see if I could just get a forum going. The choices seem to be.
- Beast - was "the" Ruby on Rails forum a couple of years ago. Now defunct
- Altered_Beast - a ground up rewrite of Beast by one of the founders (Courtenay)
- El Dorado - new kid on the block and seems to have legs
I thought I'd give Altered_Beast because I have looked at Beast in the past and because, I believe, it supports Restful authentication, which El Dorado doesn't.
I installed commit d327bb75ca4d9cd1a95cfed84676b16e3c6f923c from GitHub.
The Full Monty
This is the final set of commands to get it running. All run from the command line and starting in rails_apps:
git clone git://github.com/courtenay/altered_beast.git cd altered_beast gem install rails --version 2.3.3 mkdir log rake tmp:create cd /config ren database.sample.yml database.yml cd .. gem install rspec gem install rspec-rails gem install highline gem install RedCloth gem install bluecloth gem install ruby-openid gem install ruby-debug -v 0.9.3 mysqladmin -u root create altered_beast mysqladmin -u root create altered_beast_test rake app:bootstrap ruby script/server
Get the altered_beast code
I found a few problems with the installation instructions at Getting Altered_Beast Up and Running. This is my version ... all run from the command line and starting in rails_apps:
git clone git://github.com/courtenay/altered_beast.git cd altered_beast gem install rails --version 2.3.3 gem list --local rails rails --version mkdir log rake tmp:create cd /config ren database.sample.yml database.yml cd ..
Rails version 2.3.3
Altered_Beast needs Rails version 2.3.3 installed to work. You do this with the "gem install rails --version 2.3.3" command.
cd altered_beast gem install rails --version 2.3.3
You'll end up with multiple versions of Rails installed. The command "gem list --local rails" will tell you which ones. I have 2.3.5, 2.3.3, 2.0.2 on my machine. The command "rails --version" tells you which one is running by default. I didn't get the bottom of whether just having 2.3.3 installed was sufficient for Altered_Beast.
gem list --local rails rails --version
database.yml
You'll notice I created a database.yml by renaming database.sample.yml. This is because the command "rake gems:install" expects this file to exist. So I presume one of the component gems needs it. The real database is created at the end of the process (see below).
cd /config ren database.sample.yml database.yml cd ..
Prerequisite gems
The next step is to install the pre-requisites including:
- rspec
- rspec-rails
- highline
- RedCloth (notice mixed case name)
- bluecloth
- ruby-openid
- will_paginate (not mislav-will_paginate as the official instructions say)
- ruby-debug
Getting Altered_Beast Up and Running recommends a rake command to get all the missing gems but it always failed for me for one reason or other:
rake gems:install
The most recent time I ran this command I got this error:
gem.bat install RedCloth --source http://code.whytheluckystiff.net
ERROR: http://code.whytheluckystiff.net/ does not appear to be a repository
ERROR: could not find gem RedCloth locally or in a repository
So instead of running the rake command I went for individual installs. Notice that some of the gem names are in mixed case - the names are case sensitive.
gem install rspec gem install rspec-rails gem install highline gem install RedCloth gem install bluecloth gem install ruby-openid gem install mysql
Ruby-debug
It was fine until ruby-debug. I you try this you'll get an error:
gem install ruby-debug
The error was:
ERROR: Error installing ruby-debug:
ERROR: Failed to build gem native extension.
C:/InstantRails-2.0/ruby/bin/ruby.exe extconf.rb
creating Makefile
nmake
'nmake' is not recognized as an internal or external command,
operable program or batch file.
nmake is a Microsoft make utility that comes with Visual Studio. As it happens I've got Visual Studio installed so I could follow Amitava's Technical Diary: Gem Install Ruby-Debug fails in Windows and manually run the make. But there is a simpler way ... install an older version of ruby-debug. The problematic version is ruby-debug 0.10.0. This version doesn't build correctly on windows whereas 0.9.3 comes with a precompiled binary (Mentioned by Java on Ruby on Rails: Ruby-debug in Windows Vista). To install the Windows friendly version:
gem install ruby-debug -v 0.9.3
Create the Database and Admin User
The last step, which I haven't got to yet, is:
mysqladmin -u root create altered_beast rake app:bootstrap
The first step creates the database. The rake builds the database.yml, loads the database, builds the first site, and the admin user.
Have a Look
Start the web server
ruby script/server
Then visit http://localhost:3000 in your favourite browser.
Copying altered_beast
When I got around to building on top of altered_beast I saw no need to go through the whole palaver above. I copied the whole altered_beast directory into a new one (my_copy), then created the databases and run the boostrap. Took maybe 2 minutes.
cd my_copy mysqladmin -u root create my_copy mysqladmin -u root create my_copy_test rake app:bootstrap ruby script/server
