Thursday Oct 11, 2007

TOTD #13: Setup Mongrel for JRuby-on-Rails applications on Windows

In a previous entry, I posted instructions on how to setup Mongrel cluster for JRuby-on-Rails applications on Unix-based systems. The instructions specified there do not work on Windows-based systems because of the following reasons:

  • JRuby 1.0.1 + (default) Rails Gem (version 1.2.4) does not work on Windows because of JRUBY-1401. An older Rails version (such as 1.2.3) can always be used as described below.
  • JRuby 1.0.1 + (default) Mongrel 1.0.1 does not work on Windows because of JRUBY-1410, JRUBY-1411.

So if you want JRuby-on-Rails applications to deploy on Mongrel on Windows, then the workaround is to checkout the JRuby trunk and use Rails 1.2.3. This blog explains the instructions on how to do that. The Mongrel cluster cannot be configured on JRuby yet though.

As a side note, repeated invocation of "jruby" command will encounter JRUBY-1350. The workaround is to exit out of the current command prompt and execute the commands in a new one.

  1. Check out the workspace and build it using the following commands:

    mkdir jruby-trunk
    cd jruby-trunk
    svn co

    Add jruby-trunk/bin to your PATH.
  2. Install the required RubyGems
    1. Install Rails Gem version 1.2.3 using the command:

      C:\\workspaces\\jruby-trunk\\bin>jruby -J-Xmx384m -S gem install rails --version 1.2.3 --include-dependencies --no-ri --no-rdoc
      Bulk updating Gem source index for:
      Successfully installed rails-1.2.3
      Successfully installed rake-0.7.3
      Successfully installed activesupport-1.4.2
      Successfully installed activerecord-1.15.3
      Successfully installed actionpack-1.13.3
      Successfully installed actionmailer-1.3.3
      Successfully installed actionwebservice-1.2.3
    2. Before installing Mongrel, install the pre-requisite gems as shown below (see discussion here):

      C:\\workspaces\\jruby-trunk\\bin>jruby -S gem install gem_plugin --no-ri --no-rdoc
      Successfully installed gem_plugin-0.2.2

      and another one:

      C:\\workspaces\\jruby-trunk\\bin>jruby -S gem install cgi_multipart_eof_fix --no-ri --no-rdoc
      Successfully installed cgi_multipart_eof_fix-2.3
    3. Mongrel cannot be installed as a gem on JRuby yet. So download Mongrel gem and install it as shown below:

      C:\\workspaces\\jruby-trunk\\bin>jruby -S gem install mongrel-1.0.1-jruby.gem --no-ri --no-rdoc
      Successfully installed mongrel, version 1.0.1

      Make sure to invoke the command from the directory where the gem is downloaded.
    4. mongrel_cluster does not work with JRuby and mongrel_jcluster does not work on Windows. So Mongrel clusters cannot be configured on a Windows machine.

  3. Create a new directory jruby-trunk\\samples\\rails and create a new Rails application as shown below:

    C:\\workspaces\\jruby-trunk\\samples\\rails>..\\..\\bin\\jruby -S rails hello
    create app/controllers
    create app/helpers
    create app/models
    create log/production.log
    create log/development.log
    create log/test.log
  4. Change to the newly created directory and start Mongrel as shown below:

    C:\\workspaces\\jruby-trunk\\samples\\rails\\hello>..\\..\\..\\bin\\jruby script\\server
    => Booting Mongrel (use 'script/server webrick' to force WEBrick)
    => Rails application starting on
    => Call with -d to detach
    => Ctrl-C to shutdown server
    \*\* Ruby version is not up-to-date; loading cgi_multipart_eof_fix
    \*\* Starting Mongrel listening at
    \*\* Starting Rails with development environment...
    \*\* Rails loaded.
    \*\* Loading any Rails specific GemPlugins
    \*\* Signals ready. TERM => stop. USR2 => restart. INT => stop (no restart).
    \*\* Rails signals registered. HUP => reload (without restart). It might not work well.
    \*\* Mongrel available at
    \*\* Use CTRL-C to stop.

    The application is now available at http://localhost:3000 and shows the default "Welcome Aboard You're riding the Rails!" page. Hit Ctrl-C to stop Mongrel as shown below:

    \*\* INT signal received.
    C:/workspaces/jruby-trunk/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing': Mongrel::StopServer (Mongrel::StopServer)
            from C:/workspaces/jruby-trunk/lib/ruby/gems/1.8/gems/mongrel-1.0.1-jruby/lib/mongrel.rb:723:in `run'
            from C:/workspaces/jruby-trunk/lib/ruby/gems/1.8/gems/mongrel-1.0.1-jruby/lib/mongrel/configurator.rb:271:in `initialize'
    Terminate batch job (Y/N)? y

An alternative to this behemoth configuration and lack of Mongrel cluster on Windows is to create a Web ARchive (WAR) of your JRuby-on-Rails application and deploy on GlassFish. A complete screencast of how this can be achieved using NetBeans IDE is shown here. A comprehensive list of JRuby on GlassFish documentation is available here.

Technorati: totd rubyonrails jruby ruby mongrel windows jrubyonglassfish glassfish netbeans

Monday Apr 23, 2007

Resolved Vista Upgrade Error 80070103

Follow up from here.

After getting bounced around between Microsoft Tech Support and MSDN Tech Support (seem to be separate entities) and collecting almost 5 different toll-free numbers for them, I finally resolved the error with help from a very talented and patient MSDN Tech Support professional.

Basically, the machine had two partitions - one using Windows XP and other Linux. And somehow the Linux partition was coming out as the primary active partition. So every time I was trying to install Vista, whether from within XP or boot from DVD, it was trying to look for an empty space on this partition. And of course it was not able to find any space because this file system is not NTFS. Now when I look at the error message again, it makes sense. But can't the installation process find out that there are multiple partitions, one of them using NTFS, and then provide that information ?

With tech support help, I resolved the issue by deleting and formatting both the partitions. Another way to resolve this was to set Windows XP as the active partition following these instructions.

I almost lost faith in Microsoft Tech Support but this one talented individual helped me restore it.

Technorati: windows Vista XP microsoft

Friday Apr 20, 2007

XP -> Vista Upgrade: Error 80070103

I've been trying to upgrade an Ultra 20/4 GB RAM with Windows XP + SP2 machine to Windows Vista Ultimate and it's just a plain ugly experience. I've installed Vista on two other machines and it was a much better but this one is the other extreme.

I insert the Vista media in the drive and it pops up a window with an option "Install now". I click on install and then it shows the following error message:

It's hard to understand this error message because the primary drive has 91 GB of free disk space and installed using NTFS. Is the error message trying to convey something else ?

Searched on pointed me to this. But this article is only talking about this error code when installing updates, not updating the whole operating system. Anyway, I installed all the latest updates recommended by Windows Update Center. I also disabled my antivirus software as recommended in "What to know before installing Windows" (even though it's a weird requirement) but this error will not go away.

Tried searching if temp directory is somehow assigned smaller space but didn't find anything on that topic. Not sure if that's even possible.

I posted a question to Vista installation newsgroup. The responses there point to a mismatch (1, 2, 3) between default display drivers provided by Microsoft and nVidia. So I uninstalled the default display driver and installed nVidia's display driver. But still the same error message/number. BTW, the machine has Quadro FX 1400 card.

Then called up nVidia Tech Support. It took them few minutes to figure out that I'm "overwriting" my Window XP with Vista even though I began the call with "I'm upgrading my XP to Vista". Anyway, after the person on tech support understood my issue, I was told to format my Windows XP and then tried installing Vista from scratch! Another quote is "This is definitely a Microsoft problem because Vista is not even getting installed" even though I mentioned that all the links are referring about nVidia driver mismatch. Additionally, main website links to Can your computer run Windows Vista ? which test and reports whether a system can run Windows Vista or not. Interestingly, my laptop (which already has Vista) failed this test at Minimum, Recommended and Optimal level. And the machine on which I'm trying to install Vista passes this test at Minimum level but still giving this weird error.

Finally I called up Microsoft Tech Support and they transferred me to MSDN tech support which close at 5:30pm PT on weekdays.

As a result, I'm stuck this weekend waiting for MSDN tech support to open up Monday morning and then will follow up.

Is Windows Vista really ready for prime time for any serious application ?

UPDATE: Submitted a bug here.

Technorati: windows Vista XP nVidia

Tuesday Apr 10, 2007

Vista on an External Display

Last week, I had to give a presentation and my Tecra M5 Vista laptop would not project on the screen. After playing around with the obvious suspects (Fn keys, Toshiba Presentation Button, changing the resolution) the reason was narrowed down to not having the correct display Driver. After I installed nVidia Display Driver, Vista could project on the screen and I gave a preso yesterday using the same laptop.

There was no need to restart Vista.

Technorati: toshiba tecram5 windows vista

Monday Apr 02, 2007

Laptop upgrade to Vista Ultimate

Follow up from previous entry.

I'm doing this on Toshiba Tecra M5 S433.

The document on how to Upgrade to Windows Vista for Toshiba Tecra M5 gave two options of "manual upgrade" and "manual clean installation". I decided to go the clean installation route mainly because it's simpler and cleaner. Here are the 4 steps listed in the document:

  1. Update the computer's BIOS
  2. Download the Toshiba RAID driver (if required)
  3. Install Windows Vista
  4. Download and install Toshiba software components for Windows Vista

The first step was straight forward so I updated the BIOS to Version 3.20. 2nd step was not required. Then I used the Vista DVD to install the media. And voila, it worked! The last step was kind painful as the document lists 23 software components that need to be downloaded and installed. I talked to the technical support and they said everybody needs to individually download each piece individually and then install them. Why can't Toshiba create a package with all the components that can be downloaded and installed easily ?

Anyway, to save some effort for others, I've provided the list of all the software components after searching for a download link for each of the component:

  1. Alps Pointing Device Driver (driver_touchpad_25333A.exe)
  2. Bluetooth Monitor (util_bluetooth_monitor_25351C.exe)
  3. Bluetooth Stack (driver_bluetooth_25503A.exe)
  4. PCIe Mini Card Driver (driver_wifi_intel_25485B.exe)
  5. Intel Calistoga GM Display Driver (?)
  6. nVidia Display Driver (driver_display_nvidia_25409E.exe)
  7. SigmaTel Audio HD Driver (driver_audio_sigmatel_25410B.exe)
  8. Toshiba Fingerprint Utility (util_fingerprint_25535A.exe)
  9. Toshiba Software Modem (driver_modem_25342E.exe)
  10. CD/DVD Drive Acoustic Silencer (util_drive_silencer_25330E.exe)
  11. Config Free (util_config_free_25573A.exe)
  12. TOSHIBA Assist (util_assist_25533A.exe)
  13. TOSHIBA Disc Creator (util_disc_creator_25489B.exe)
  14. TOSHIBA Extended Tiles for Windows Mobility Center (util_extended_tiles_25331C.exe)
  15. Toshiba HDD Protection (util_hdd_protection_25580A.exe)
  16. TOSHIBA IE Favorites Links
  17. TOSHIBA SD Memory Boot Utility (util_sd_memory_boot_25469C.exe)
  18. TOSHIBA SD Memory Utilities (util_sd_memory_25479B.exe)
  19. TOSHIBA Security Assist (util_security_assist_25329B.exe)
  20. Toshiba Software Upgrades (util_software_upgrades_25157C.exe)
  21. TOSHIBA Value Added Package (util_tvap_25459E.exe)
  22. User's Guide - Unattended Installation
  23. Wireless Key Logon (util_wireless_key_logon_25356D.exe)

This was quite a time consuming process since I had to search for exact match of my laptop's model (Tecra M5 S433) and then copy/paste the link etc. Anyway of the entire list, so far I've installed #9 since that allows me to login to my laptop using biometrics and I love that functionality. May be I'll install others later but I'm good for now.

As I mentioned earlier, this entry is indeed from my laptop with Vista Ultimate now. One good thing with Vista installation is that it preserved all my personal data (which is huge directory space) so there was no need for backing up the laptop. Instead it moved Windows, Program Files and Documents and Settings directories to windows.old. This makes using old data really easy.

So overall, not a bad experience but I spent significant part of my Sunday doing this installation. Hopefully this will save some time for you.

Technorati: toshiba tecram5 windows vista

Sunday Apr 01, 2007

Upgrading Toshiba TecraM5 from XP to Vista

I decided to upgrade my Toshiba Tecra M5 laptop with Windows Vista, finally!

The laptop has the logo "Designed for Windows XP, Windows Vista Capable". A laptop equipped with Windows Vista Capable  meets minimum requirements of 512 MB RAM which does not necessarily mean you'll be able to run all your Windows Vista applications. Rather Vista will deliver sub-XP performance. So I'm not sure how this logo needs to be interpreted.

Anyway, I downloaded Vista and started installing and got the error "Windows cannot be installed on this computer with the current system BIOS version. Contact your computer manufacturer for a BIOS update, install the update, and then start Windows installation again. OEM Name: TOSHIBA; OEM Model: TECRA M5; BIOS Version: v1.60 ; BIOS Date: 20060803000000.000000+000".

Even though the laptop is advertised Vista capable but still need a BIOS update. Why ? where all the BIOS updates can be downloaded was down most of this morning and so no updates could be downloaded. Toshiba Tech Support told me that new drivers are uploaded to the website but I don't understand why the complete website has to be down for that.

I found out about Windows Vista Upgrade Advisor from the recorded message at the Tech Support. So I downloaded that and got the same error "Windows Vista Upgrade Advisor encountered an error while scanning your system. If the problem persist, you can uninstall and reinstall the latest version." I'm using the latest version available on their website so this error message makes no sense.

Finally, is now live and I found instructions on how to Upgrade to Windows Vista for Toshiba Tecra M5. This is exactly what I've been looking for and fortunately this document was posted on 3/28 (3 days ago). I'm going to follow the instructions here and provide an update later today.

I'm hoping my next blog will be from my upgraded Vista laptop but so far the experience has not been very pleasant. Fingers crossed!

Technorati: toshiba tecram5 windows vista


profile image
Arun Gupta is a technology enthusiast, a passionate runner, author, and a community guy who works for Oracle Corp.

Java EE 7 Samples

Stay Connected


« July 2016