Set the controls to lightly toasted muffins... RSS 2.0
 Friday, October 20, 2006

I got tripped up by this error last night when posting an article to dasBlog from Windows Live Writer:

Blog Server Error: Server Error 0 Occurred - Object reference not set to an instance of an object

Here's a couple of links to the reasons why it happens and what to do to get round it:

http://daptivate.com/archive/2006/10/02/Windows-Li...
http://blogs.msdn.com/peterlau/archive/2006/08/15/...

Friday, October 20, 2006 1:15:43 PM UTC  #    Comments [0] -

Having played around with InstantRails for a bit I decided I needed to know how to install Ruby on Rails manually. Now I know there are Ruby MSI installers for windows but there's nothing like doing it the long way to get to know and understand what gets installed, where it belongs and if it breaks then you're familiar with the installation.

So here goes...

1. What Do I Download and Where From?

First off go grab these files -

http://rubyforge.org/frs/?group_id=426&release_id=5757 - Ruby 1.8.5
http://rubyforge.org/frs/download.php/11290/rubygems-0.9.0.zip - RubyGems 0.9.0
http://www.zlib.net/zlib123-dll.zip - zlib 1.2.3
http://prdownloads.sourceforge.net/gettext/libiconv-1.9.1.bin.woe32.zip?download - iconv 1.9.1

It's best to create a subfolder in your favourite downloads directory and download these four files to there and then unzip each one individually to it's own folder.

2. Where Do I Put It All?

Rather than deploy into the Program Files folder (spaces in folder names still seems to send the willies up some of these OS projects occasionally) I created a folder in the root of my c: drive called RubyTools. I then copied the unzipped ruby-1.8.5 folder and rubygems-0.9.0 folders to  c:\RubyTools.

Just a couple of points here - the Ruby interpreter zip file and uncompressed folder is called ruby-1.8.5-i386-mswin32, I shortened it to ruby-1.8.5 after copying to make typing easier. In Winzip or WinRAR if you 'Extract to \rubygems-0.9.0' rather than 'Extract to here' you end up with an extra subfolder called rubygems-0.9.0...just so you know.

So after copying to my RubyTools folder, this is what my folder structure looks like:

>

 

Next copy the zlib1.dll file to your Windows system32 folder and rename it zlib.dll. On my first attempt to install RubyGems (see further on) it crapped out with an error saying it couldn't locate zlib.dll. You may already have zlib installed so try that version first.

Finally copy iconv.dll from the extracted iconv bin folder (.\libiconv-1.9.1.bin.woe32\bin)  to your Windows system32 folder. This is a character set conversion library and the Rails project installer will complain if it's not there. Read more about it here http://wiki.rubyonrails.com/rails/pages/iconv.

3. Set Your PATH

Add the path to the ruby.exe executable to your environment PATH variable. If your forgot or don't know how to do this:

Right Click + My Computer
click on the Advanced Tab
click on the Environment Variables button
    then either -
select the PATH variable in the 'System variables' list
click the Edit button
append the path to the ruby executable
   ...or...
create a new Environment variable called RUBY and set the path here
append ;%RUBY% to PATH (you need to include the semi-colon if it's not there already)

4. Install RubyGem Package Manager

Open a command prompt window and change directory the rubygems-0.9.0 e.g. cd \rubytools\rubygems-0.9.0

Type: ruby setup.rb and hit return. You should see something like this from the installer -

C:\RubyTools\rubygems-0.9.0>ruby setup.rb
---> bin
<--- bin
---> lib
[snipped for brevity]
---> lib/rbconfig
<--- lib/rbconfig
---> lib/rubygems
<--- lib/rubygems
<--- lib
rm -f InstalledFiles
---> bin
mkdir -p C:/RubyTools/ruby-1.8.5/bin/
install gem C:/RubyTools/ruby-1.8.5/bin/
install gemlock C:/RubyTools/ruby-1.8.5/bin/
[snipped for brevity]
As of RubyGems 0.8.0, library stubs are no longer needed.
Searching $LOAD_PATH for stubs to optionally delete (may take a while)...
...done.
No library stubs found.

Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem

C:\RubyTools\rubygems-0.9.0>

And that's the RubyGems package manager installed.

5. Install Rails

Keep the command prompt window open and type: gem install rails --include-dependencies then hit return. You'll then see Gem work it's magic and grab the latest version of Rails (1.1.6 at the time of writing): 

C:\RubyTools\rubygems-0.9.0>gem install rails --include-dependencies
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.1.6
Successfully installed rake-0.7.1
Successfully installed activesupport-1.3.1
Successfully installed activerecord-1.14.4
Successfully installed actionpack-1.12.5
Successfully installed actionmailer-1.2.5
Successfully installed actionwebservice-1.1.6
Installing ri documentation for rake-0.7.1...
Installing ri documentation for activesupport-1.3.1...
[snipped for brevity]
Installing RDoc documentation for rake-0.7.1...
Installing RDoc documentation for activesupport-1.3.1...
Installing RDoc documentation for activerecord-1.14.4...
Installing RDoc documentation for actionpack-1.12.5...
Installing RDoc documentation for actionmailer-1.2.5...
Installing RDoc documentation for actionwebservice-1.1.6...
C:\RubyTools\rubygems-0.9.0>

You might get a couple of messages along the lines of -

While generating documentation for activesupport-1.3.1
... MESSAGE: Unhandled special: Special: type=17, text="<!-- HI -->"
... RDOC args: --ri --op C:/RubyTools/ruby-1.8.5/lib/ruby/gems/1.8/doc/activesu
port-1.3.1/ri --quiet lib
(continuing with the rest of the installation)

...and...

While generating documentation for actionpack-1.12.5
... MESSAGE: Unhandled special: Special: type=17, text="<!-- The header part
f this layout -->"
... RDOC args: --ri --op C:/RubyTools/ruby-1.8.5/lib/ruby/gems/1.8/doc/actionpa
k-1.12.5/ri --quiet lib
(continuing with the rest of the installation)

This is apparently quite common on Windows platforms and it doesn't seem to affect anything from what I could google.

So we're done with the install bit, next time we test our Rails installation to see if it hangs together.

Friday, October 20, 2006 2:10:57 AM UTC  #    Comments [0] -
Techy | Ruby | Rails
 Thursday, October 19, 2006

This turned up in my dasBlog referrer logs:

Kitten Authentication Rails?....eh?...maybe these little guys need them just to make sure that they're secure and don't get worms and viruses?

Sorry Martin :P

Thursday, October 19, 2006 9:43:46 PM UTC  #    Comments [0] -

 Tuesday, October 17, 2006

Didn't see it at the cinema so bought the DVD. Whilst the cast and the locations are great, the rest of the film didn't really keep me interested, it's a bit dull (with a small 'd') and not as much fun as the book. 4/10. National Treasure was much more fun.

Tuesday, October 17, 2006 5:35:49 PM UTC  #    Comments [0] -

If there's just one more ASP.NET 2.0 book you buy before the year is out then it should be 'Developing More-Secure Microsoft ASP.NET 2.0 Applications' by Dominick Baier. I haven't read the book cover to cover yet but chapter 8 - 'Partial Trust ASP.NET' alone should have you running to the bookstore to get this title if you care about securing your ASP.NET 2.0 infrastructure.

Tuesday, October 17, 2006 5:27:14 PM UTC  #    Comments [0] -

Now Playing
Top Artists This Week
Fluff

Powered by FeedBurner
Categories
Archive
<October 2006>
SunMonTueWedThuFriSat
24252627282930
1234567
891011121314
15161718192021
22232425262728
2930311234
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Kevin Kenny
Sign In
Statistics
Total Posts: 194
This Year: 41
This Month: 0
This Week: 0
Comments: 101
All Content © 2008, Kevin Kenny
DasBlog theme 'Business' created by Christoph De Baene (delarou)