MethodBox:WindowsInstallation

Install Rails

 * 1) Install the Web Platform Installer from http://www.microsoft.com/web/downloads/platform.aspx
 * 2) Add http://www.helicontech.com/zoo/feed as a new feed
 * 3) From the zoo tab select Blank Ruby on Rails Rails project and Ruby1.8 and click the install button. It will also install other dependencies.
 * 4) When installing the blank project it will pop up and ask you where to put it along with other required details like the name. Make a note of where the project lives since we need a couple of files from it.
 * 5) From the blank rails project we need the web.config files in the projects root and public directories.  Place these in the same place in the methodbox directories.  To use Ruby1.9 we need to replace ruby.1.9.pipe in the web.config in the projects root directory with ruby.1.8.pipe.
 * 6) Ensure that the projects directories are writeable by the IIS_IUSRS user.
 * 7) Add the project to IIS with the project path pointing to the rails projects root directory (not public like you would with a rails project under apache).

Install Git
This is used for version control and can be found on http://git-scm.com/ Install the version marked 'Full installer for official Git for Windows 1.7.8' or similar (version name might be different).

Download the Methodbox code
Check out the methodbox code using git clone git://github.com/myGrid/methodbox.git This puts the code in a methodbox directory

Install required gems
There are various 3rd party dependencies that the gems that MethodBox use require. On windows this requires a little bit of user intervention during the install process. Go to http://www.imagemagick.org/script/binary-releases.php?ImageMagick=uteqfietdab37ghqrvfuvoul55#windows and download http://www.imagemagick.org/download/binaries/ImageMagick-6.7.3-7-Q16-windows-dll.exe Double click and go through the installer, selecting to install C and C++ header files and libraries from the additional options page add environmant variable CPATH=\path\to\imagemagick\include and LIBRARY_PATH=\path\to\imagemagick\lib Start a new command terminal, go to the methodbox root directory and enter bundle install, this will download and install any ruby gems needed

Run rake -T to have a look at the tasks you can run. There is a high chance that the libxml-2.2.dll needed for libxml-ruby is not present in the lib folder and will pop up an error. The dll can be found in C:\Ruby18\lib\ruby\gems\1.8\gems\libxml-ruby-2.2.0-x86-mingw32\lib\libs\ Copy the libxml, iconv and zlib dlls and put in the C:\Ruby18\bin folder.

Try running rake -T again to check that everything is OK.

SQL server and rails

 * 1) Find out your SQL server details. If your SQL server instance has not been allowed through the firewall then you need to find out its details: open up the sqlserver management console (which you can install along with sqlserver express via the Web Platform Installer - I recommend this way, downloading on its own and installing does not work correctly) and look at your db details.
 * 2) Set up a Data Source Name (DSN) for your ODBC connection.  This is not that well documented so you need to find the C:\Windows\sysWOW64 directory and start the odbcad32 programme.  Then you add a system DSN for your instance of sqlserver.
 * 3) Set up your rails projects database.yml as normal with the following records:

adapter: sqlserver mode: odbc dsn: sqlserverapp-dsn (the one you created earlier) username: user password: secret host: localhost (or whatever)

Configure Methodbox and set up database
Follow the methodbox readme and create the config files needed. You need to point various paths in the environment_local.rb file to places on your directory where you want files to be stored.

Use rake db:schema:load to create the database. Note: If you are not using mysql then comment the mysql gem out of the Gemfile. Otherwise the system may complain about libmysql.dll missing. This is a problem if you are using mysql in which case you need to copy the dll from the mysql/bin folder to the ruby lib folder.