Contributor(s): Andres Montano, Steve Weinberger, Than Grove
Windows is a more difficult environment to work with ROR in, since most ROR developers use Macs or Linux. These are notes about things to keep in mind when installing THL RoR apps on Windows machines (assuming you have a 32-bit system):
gem install rails -v 2.3.4 --no-ri --no-rdoc --platform=mswin32 gem install mysql --no-ri --no-rdoc --platform=mswin32 gem install hpricot --no-ri --no-rdoc --platform=mswin32
gem install ruby-debug gem install rack-openid -v0.2.2 gem install hpricot
The requirements for the mysql gem are different, based in part on what operating system you're running. For systems 10.5 and below:
sudo env ARCHFLAGS="-arch i386" gem install mysql --
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib
--with-mysql-include=/usr/local/mysql/include
For 10.6:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql --
--with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib
--with-mysql-include=/usr/local/mysql/include
If you discover errors later calling for specific gems that are not installed, it's possible that this documentation is behind the development of the app. Just run gem install for whatever gem it says is missing.
THL Ruby on Rails projects are hosted on GIT hub at http://github.com/THL. To access the code, do the following:
Once the code is initially downloaded it should be up to date but before one begins working on a local version it is always good to update it first using the following two commands:
{Need to add link to information from old Google Wave document}
To run an ROR app locally you will need the corresponding data. You need to talk to a THL administrator about acquiring the required data for the app. This will come in a gzipped or zipped file. You will need to unzip it and import it into your local database program. These instructions discuss MySQL but some ROR apps use PostGres. The name of the database will generally be "{name of app}_development", e.g. "kmaps_development", etc, and you will need a data dump for that database to import into a local version of it. The following list will outline the steps needed to install the data for the Kmaps app:
development:
adapter: mysql
encoding: utf8
reconnect: false
database: kmaps_development
pool: 5
username: root
password:
host: localhost
The database, username, and passwords fields should all match the corresponding info for your localhost database for that app and for general MySQL logon.
Then to run the app you open a command window by pressing the windows button and "R" and typing "cmd". Navigate to the directory as in
>cd C:\thl-repos\thl-rails\kmaps\ >ruby script/server
Then the app will be running at: http://localhost:3000/
From:
elsif hostname.ends_with? 'local' self.site = 'http://localhost/master/kmaps/'
To:
elsif hostname.ends_with? 'local' self.site = 'http://dev.<app abbreviation>.thlib.org/'
The app abbreviations are "tmb" for kmaps, "mms" for the media management system, and "places" for the places dictionary.