Archive for June, 2008

Setting Up Development Environment For Grails on Windows Vista/XP

11

Just as Ruby on Rails started to get wide publicity in the media for providing a surprisingly productive web application development framework, many people using other web development technologies suddenly started to wonder if their environment is missing something. Some introspection later, while some tried to add more productive features to their favourite technologies, some others went ahead and committed themselves to create a Ruby on Rails like framework for their own favourite programming language or platform. Where frameworks like TurboGears, Django come close to the model of Ruby on Rails and provided an excellent alternative for the Python programmers, one framework that comes the closest, in my opinion, is the Grails framework, and what good news it is for the Groovy and Java guys looking for an alternative way of developing web applications.

While Grails may yet lack the complete feature set and level of support available for the Ruby on Rails framework, it is very much a stable framework now and currently used by many websites in production environment. Below is the procedure to get everything needed to start creating web applications in Groovy using the Grails framework.

  1. Download and install the latest version of Java SE(currently JDK 6 update 6).
    Skip to the next step if you plan to use NetBeans or some other IDE. If you want to work with a text editor and the command prompt, you need to set the following environment variables:
    Go to Control Panel -> System -> Advanced System Settings and click the “Environment Variables” button. (Or Control Panel -> System, select the Advanced tab and click the “Environment Variables” button if you are using Windows XP).

    Add the path to Java bin directory to the system PATH variable.
    Add a new system environment variable called JAVA_HOME and set it to the path to your Java installation directory.
    Set Java environment variables in Windows
    For more details, refer to Sun’s instructions on how to install Java SE.

  2. Download and install the latest stable version of the Groovy windows installer(currently 1.5.6).
    Download the latest stable version of Groovy windows isntaller
    Make sure that you install Groovy to a path that doesn’t contain any spaces in it; so you need to remember to change the default path in the installer from “C:\Program Files\Groovy” to something like “C:\groovy”. Also make sure that you select the checkboxes to add Groovy’s directories to system environment variables.
    Select install path for Groovy that contains no spaces in it
    Select install path for Groovy that contains no spaces in it
    Select environment variables to be created by the Groovy windows installer

    For all the other settings, you can just accept the defaults. To confirm that Groovy is installed and all the environment variables are properly set, run the following command in the command prompt:

    C:\> groovy -v
    Groovy Version: 1.5.6 JVM: 10.0-b22

    If you get an error instead, carefully check again that the environment variables PATH and GROOVY_HOME are properly set.

  3. Repeat the similar process with the Grails installer: Download the latest stable version of the Grails installer and run it.
    Download the latest stable version of Grails Windows Installer
    Unlike the Groovy installer, Grails installer doesn’t create any environment variables, so we have to create them manually. Create a new environment variable called GRAILS_HOME and set it to the Grails installation path.
    Set Grails HOME environment variable in Windows
    Also add Grails’s bin directory to the PATH system environment variable:
    PATH=%JAVA_HOME%\bin;%GROOVY_HOME%\bin;%GRAILS_HOME%\bin

    To make sure that Grails is installed and the environment variables are set properly, run the following command:

    C:\Users\tabrez>grails -v

    Welcome to Grails 1.0.2 – http://grails.org/
    Licensed under Apache Standard Li
    Grails home is set to: C:\grails

  4. Now proceed to the next part of this tutorial and create an example “Hello World” web application using Grails framework to validate your Grails installation on Windows operating system.

Setting Up Rails Development Environment on Windows Vista/XP

19

There are different ways in which you might want to set up a complete development environment for Ruby on Rails on a Windows machine. I am going to cover how to setup Rails on a Windows machine using Ruby, RubyGems, Rails, Mongrel, MySQL, NetBeans and Subversion as part of the development stack. I will be using Windows Vista as the reference OS but most of the instructions work for Windows XP too.

  1. Installing Ruby: Download and install the latest final version of the Ruby installer(currently 1.8.6) from the rubyforge.net website: One-Click Ruby Installer for Windows

    Leave all the default settings as they are and proceed with the installation wizard. It is important that you install Ruby in a path which doesn’t contain any spaces in it(the path c:\ruby selected in the wizard by default works fine).

    After the installation is complete, confirm that the ruby commands are added to the system path. Start the Command Prompt(Start -> Accessories -> Command Prompt) and type the following command:

    C:\> ruby -v
    ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]
    C:\> gem -v
    0.9.4

    If you get the “not recognized as an internal or external command” error, add the path to the ruby bin directory(e.g. c:\ruby\bin) to the system PATH environment variable(Control Panel -> System -> Advanced System Settings).

  2. Updating RubyGems:
    The above installer also installs RubyGems package and SciTE editor as part of the “one-click” installation process. Unfortunately though, the installed version of RubyGems may be a bit old(~0.9.4), so run the following command to update it to the latest available version(currently 1.1.1):

    C:\> gem update ––system
    C:\> gem -v
    1.1.1

    Note: Add “-p http://proxy:port” to all gem install commands if you are connecting to the Internet through a proxy.

  3. Installing Rails:
    Now it is time to install the Rails package. Run the following command to install Rails as a ruby gem:

    C:\> gem install rails
    C:\> rails -v
    2.1.0

    In future, whenever you want to update Rails to a newer version, simply run the following command:

    C:\> gem update rails

The basic Rails development environment is now installed on your system and you can skip the rest of the post if you are happy with WEBrick as the web server, SQLite as the database server and SciTE as the editor(or your favourite text editor/IDE already installed on your system). The following instructions cover installing an alternate web server called Mongrel; MySQL database server and its GUI tools; NetBeans IDE, Subversion and their integration.

  1. Installing Mongrel:
    Installing the Rails gem also installs the WEBrick web server which is ideally suited for development purposes. Another much recommended web server for Rails development as well as production environment is the Mongrel web server. To install the Mongrel web server, run the following gem command:

    C:\> gem install mongrel
    C:\> gem list mongrel

    *** LOCAL GEMS ***

    mongrel (1.1.5)

    After installing Mongrel, Rails automatically starts the Mongrel instead of WEBrick web server when you run the Rails applications in development mode. (Refer to Mongrel documentation to know more about runing Rails applications under Mongrel in production mode.)

  2. Installing MySQL:
    This step covers the installation of MySQL database server and its GUI tools. Skip this step if you want to use some other database server.

    Download and install the MySQL 5 database server. You can safely accept all the default settings of the installation wizard. After MySQL database server is installed, you need to run its configuration wizard to configure the MySQL installation.

    • If you are a Windows XP user, run the configuration wizard directly from Start -> MySQL -> MySQL Server 5.0 -> MySQL Server Instance Config Wizard.
    • If you are a Windows Vista user, you first need to patch the configuration wizard before running it. Follow these instructions to patch the MySQL configuration executable using ResHack utility. Once that is done, you can run the configuration wizard from Start -> MySQL -> MySQL Server 5.0 -> MySQL Server Instance Config Wizard.

    One important step during the configuration process is to select a root password(you will need to enter it in the database.yml configuration file of your Rails application).

    Now download and install the MySQL GUI tools. This step can be skipped if you want to use mysql command line tools or if you prefer other GUI front-ends like HeidiSQL.

  3. Installing Netbeans:
    You can use your favourite text editor or IDE to code your Rails application. Two of the most popular, Free Rails IDEs are NetBeans and Eclipse. NetBeans in particular has shown great improvement in its support for Ruby programming language and the Rails framework. I am going to cover configuring Netbeans for developing applications with Rails, so feel free to skip this step if you want to go with some other IDE(Aptana, IntelliJ IDEA etc.).

    Go to the download page of Netbeans IDE and download either the “Ruby” version(~29MB) or the “All” version(~219MB). (Ruby version supports only Ruby where as the All version supports Java, C++, etc. in addition to Ruby.)
    Install NetBeans. Run it. When creating a new Rails project in NetBeans, remember to select “Ruby” as the default instead of the default “JRuby” and then select Mongrel as the web server.
    Ruby on Rails configuration dialog box in NetBeans

    For more information on developing Ruby on Rails applications using the NetBeans IDE, refer to the following links:

    There are many alternative IDEs that you can checkout, like Aptana Studio, Komodo, IntelliJ IDEA, etc.

  4. Installing Subversion:
    Go to the Subversion download page, scroll down to the Windows section and click the “Win32 packages built against Apache 2.2″ link and download and install the ‘basic win32 binaries’ package.

    Download Subversion package for Windows Download Subversion package for Windows

    You can now work with the Rails applications stored in subversion repositories. You can also install and use TortoiseSVN which is a GUI subversion client that integrates very well with the Windows Explorer. I couldn’t find a way to integrated it with NetBeans though, so I install the subversion command line version to use with NetBeans even if I have TortoiseSVN installed on my system.

  5. Configuring Subversion in NetBeans:
    Start the NetBeans IDE and go to Versioning -> Subversion -> Checkout. If you see a dialog box as shown in the screenshot below, it means subversion is properly installed and configured on your system. You can enter the repository details in the fields shown by the wizard, checkout a Rails application and work on it from the NetBeans IDE.

    Subversion configuration dialog box in NetBeans

    (If you see an error instead, then you need to either add the subversion bin directory to the system PATH variable or enter the path in the shown NetBeans configuration window.)

    NetBeans has direct support for CVS, Subversion and Mercurial and NetBeans support for Git is currently under development.

Now you can create/checkout rails applications, edit them and run them under Mongrel from within the NetBeans IDE. One crucial item missing from this development environment is an alternative, more powerful automated build tool CruiseControl, which can also be integrated with NetBeans. Perhaps a topic for another post. In the next post I will explain how to create a basic “Hello World” application in Rails using the above development tools.

buy prednisone medication COD purchase prednisone without prescription needed purchase prednisone prescription online prednisone no prior script prednisone no rx needed order prednisone usa cod buy prednisone without rx from us pharmacy buy prednisone online without rx purchase prednisone without prescription order prednisone saturday delivery buy prednisone amex online without prescription ordering prednisone over the counter buy prednisone amex online without rx where can i buy Prednisone ordering Paxil over the counter order Paxil without rx needed order Paxil pharmacy Paxil overnight delivery fed ex ordering Paxil without a script order Paxil order amex order Paxil amex online without prescription buy Paxil pay pal without prescription order rx free Paxil cheapest Paxil available online purchase Paxil without purchase Paxil without prescription how to order Paxil online without a prescription purchase Paxil cod next day delivery buy discount Paxil online buy Paxil no visa online without rx where to buy accutane buy frontpage software cheap mortgage application software buy autocad software best price for final draft 7 software iphone software download plagiarism software to buy for parents Crestor side effects buy masterwriter software discount bmi sesac microsoft software downloads wm5 software download treo software download cheap discount software xxasdf discount trellian software best antivirus software download cheap microsoft word software buy software for mac software discounts for educators microsoft office purchase Prednisone online no membership buy windows xp oem software buy flash cs3 software photoshop cs 5 full fashion conference italy buy Orlistat with amex ordering Lasix over the counter purchase online prescription Lasix without windows 7 product key purchase online cheapest xenical available online prescription xenical online online Maxalt achat Maxalt Valtrex with repronex where to buy Valtrex by cod where to purchase generic valtrex online without a prescription quality generic valtrex cheap valtrex usa (no prescriptions needed for Buspar|buy Buspar with no prescription|online pharmacies Buspar|Buspar cheap|buy Buspar without rx|purchase rx Buspar without|Buspar purchase online|purchase Buspar online without rx|purchase Buspar free consultation|buy Buspar Online|buy Buspar american express|buy Buspar Online|buy cheap Buspar with dr. prescription|Buspar side effects|fedex Buspar without priscription|overnight Buspar without a rx|order cheap overnight Buspar|Buspar toronto|uk order Buspar|Buspar no doctors prescription|Buspar mexico|Buspar order|no prescription Buspar with fedex|order generic Buspar|buy Buspar without rx from us pharmacy|prezzo Buspar|Buspar 10mg|Buspar from canada|purchasing Buspar without a script|buy Buspar australia|purchase Buspar visa without prescription|online purchase Buspar|buy Buspar no perscription cod|buy Buspar drugs|buy Buspar with visa|buy Buspar without rx needed|buy Buspar without prescription|buy Buspar no prescription low cost|purchase purchase Buspar no prescription cheap buy cheap Nolvadex cod buy Nolvadex infertility in internet visa at Wisconsin Ontario omicrosoft office 2003 megaupload online purchase Lasix Buy genuine accutane online buy nolvadex amex online where to buy synthroid in germany where to buy synthroid pills cheap discount Nolvadex overnight Accutane 20mg mexico order Lasix usa Lasix overnight delivery fed ex buy zithromax overnight purchase online prescription zithromax without buy Nolvadex cheap cheapest Nolvadex available online buy Nolvadex without rx from us pharmacy buy Nolvadex without a prescription overnight delivery buy 20mg Nolvadex free shipping buy Nolvadex no prescription order zithromax overnight delivery buy zithromax 100 mg visa Valtrex without doctor prescription buying zithromax over the counter order zithromax with no prescription order zithromax 250mg mastercard order zithromax 250 mg visa order zithromax 500mg amex buy mail order Orlistat buy Valtrex online now Orlistat tablets purchase cheap Maxalt onlinebuy generic Maxalt pills free fedex delivery Buspar buy cheap Finpecia under without rx purchase online finpecia without rx finpecia fedex no prescription buy line finpecia fedex Valtrex overnight without a rx Buspar u.p.s shipping cod order cheap overnight Buspar free fedex delivery prednisone prednisone no script fedex buy valtrex cheap without prescription generic Valtrex fedex Online overnight shipping Valtrex purchase Zithromax without purchase Zithromax no scams Arimidex delivered overnight order cheap overnight Arimidex purchase Cytotec over the counter fedex buy Cytotec online overnight adobe financial results microsoft office professional 2007 upgrade download microsoft office professional 2007 cheap Buspar by money order how to buy Valtrex without a prescription cheap valtrex uk buy Flomax in the uk purchase Proscar usa cod adobe lm service adobe after effects simple creativity latest adobe flash download buy Crestor amex measurement software Photoshop For Sale buy discount Tamsulosin line Autocad 2010 Review download adobe premiere complete removal of office 2003 adobe indesign cs2 photoshop lightroom 3 cheap where can i buy herbal Crestor where to buy Crestor buy Crestor online cod Buy Fincar online 5 mg mastercard cheapest price for microsoft office vio software discount coupon purchase Orlistat amex online without prescription buy maxalt online without a prescription adobe photoshop 6 cd key Cheap Software Buy Downloads For Photoshop flash catalyst sql ms office 2010 enterprise windows 7 upgrade oem Windows Server 2003 Standard Edition Downloads For Windows 7 Ultimate buy Valtrex no prescriptions application free download office microcoft2007 buy Crestor drugs Valtrex no prescription purchase Valtrex amex online without prescription Xenical Orlistat Flomax buy on line boilsoft viseo create new instrument logic studio 9 cheap purchase finpecia Flomax best buy buy cheap oem software formica countertop cyberlink power dvd 9 download buy Prednisone no prescriptions cheap indesign cs android acdsee buy Flomax australia generic Valtrex online lightroom license .txt download de driver para corel windvd buy microsoft office online cheap generic Valtrex online buy Flomax online no prescription buy pharmacy Flomax waterview cheap Valtrex by money order ifinance price price of valtrex buy valtrex doctor prescription buy generic Crestor order generic Tamsulosin imtoo dvd ripper serial look like buy Buspar without a rx cheap digital video buy Prednisone amex want to buy Buspar in malaysia Bupropion buy Bupropion buy no perscription Amitriptyline buy discount Zithromax cheapest Zithromax available online how to order Buspar online without a rx purchase prednisone cod next day delivery where can i purchase prednisone online prednisone online cash on delivery microsoft office 2010 3 user license cheap mac desktops no prescription Orlistat cod delivery Work Order Tracking System Acrobat 6.0 Professional Oem Version Windows 7 buy Valtrex where order Orlistat no rx cheap proffes Microsoft Windows Xp Purchase buy Valtrex legally Windows Xp Server buy cheap online pharmacy Buspar buy Prednisone online now generic Zithromax usa accutane 40 mg delivered overnight buy accutane 40 mg with no prescription media 8 oline cheap cs software Discount Microsoft WindowsLightroom 2 Windows 7Ms Office StandardPhotoshop Cs5 UpgradeComputer Monitors For SaleWindows Xp InstallSuite Microsoft OfficeAutocad Version 2007Adobe Acrobat 9.0 Standard DownloadIe8 Download For Windows 7Adobe Paint ShopMicrosoft Service Pack 2Free Download Adobe AcrobatStudent And Teacher EditionManage ImageAdobe Acrobat 7 Pro DownloadVista Home Premium To Windows 7 UltimateWindows 7 Home Premium Upgrade OemAdobe Creative Suite 5 Master Collection Student And Teacher EditionBuy Adobe Photoshop Lightroom 3Ms Office 2010 Home And StudentCompare Photo SoftwareMicrosoft Office Word Viewer 2010Windows 7 Upgrade Student Discount ProfessionalWindows 7 Updates DownloadCreative Suite WebAdobe Reader VistaMicrosoft Windows 7 Home Premium Upgrade 64 BitPhotoshop 2Ie8 Download For Windows 7Photoshop 2009Suite Microsoft OfficeMicrosoft Office 2007 VersionUpgrade Windows Vista To 7Autocad Lt 2010Autocad 2010 Best PriceDownload Acrobat Reader 8 buy Flomax online us pharmacy cheapest Buspar available online where can i purchase Buspar without a prescription sony oem software Valtrex from india Prednisone prescription order Buspar shipped by cash on delivery buy Valtrex with no prescription prezzo Valtrex buy Valtrex shipped cod Proscar no prescription overnight Proscar overnight no consult where to purchase cheap Cytotec no rx Cytotec to buy is it legal to buy Cytotec online in australia buy Cytotec cheapest buy finpecia without prescription finpecia buy cod want to buy finpecia in malaysia buy finpecia with mastercard Buy Finpecia 1 mg online microsoft onenote and educator discount window mirror film charset windows 1252 reinstal windows finpecia overdose excel new window windows for loop microsoft office 2008 for mac home student cheap collection software virtual dj software web design software mac cheap or discount photoshop software load windows xp buy Orlistat legally Rosuvastatin generic order buspar pharmacy buy Flomax in mo dreamweaver cs4 windows mobile opera adobe photoshop price epson creativity suite
Go to Top