Code For Ror Apps In Git

THL Toolbox > Developers' Zone > Web Development > Code for RoR Apps in GIT

Code for RoR Apps in GIT

Contributor(s): Andres Montano

All the THL Rails projects are in external link: http://github.com/thl (projects include both the applications and the plugins).

Rails with Postgres

  1. Download the installer from external link: http://code.google.com/p/msysgit/downloads/list
    1. The current installer version for Windows is Git-1.7.3.1-preview20101002.exe
  2. Install GIT
  3. Create an account on GitHub: external link: http://github.com/

To set up localhost to run Place Dictionary:

  1. Launch Git Bash (should be a shortcut icon on your desktop)
  2. Log in to GitHub at external link: http://github.com
  3. Click on Need help with public keys link
  4. Or, go to external link: http://help.github.com/msysgit-key-setup/
  5. Follow the instructions for generating a SSH public key
  6. Follow the instructions for adding a key to your GitHub
  7. Go back to external link: https://github.com/account

Open id_rsa with a text editor; copy the public key and paste it into the Key box on external link: https://github.com/account

Install the Place Dictionary

  1. On your hard drive, create a folder outside of subversion folders: thl-rails
  2. add the folder program files/git/bin: right-click on Control panels > Advanced system settings > system properties > Environment variables > edit system variables; paste in at the end ;C:Program FilesGitbin
  3. Open GitBash and cd to the thl-rails folder you just created
  4. Run the command: git clone git@github.com:thl/places.git
  5. It will say: "cloning into places…"
  6. Type yes in answer to are you sure you want to conintue connecting (yes/no)?
  7. cd places (c:/thl-rails/places)
  8. run the command: git submodule init
  9. run the command: git submodule update
  10. exit GitBash

Install Ruby

  1. Go to external link: http://rubyforge.org/frs/download.php/72085/rubyinstaller-1.8.7-p302.exe
  2. Run the ruby installer
  3. Click on Start Command prompt with Ruby from the Ruby folder
  4. run: gem list (m,akes sure Ruby is installed properly)

Install Rails

  1. In the Ruby command prompt window, run: gem install rails -v 2.3.4 --no-ri --no-rdoc --platform=mswin32

Install hpricot

  1. In the Ruby command prompt window, run: gem install hpricot --no-ri --no-rdoc --platform=mswin32

  1. cd thl-rails/places/config
  2. Run ls
  3. In Windows Explorer, go into thl-rails/places/config and copy the file database.example; paste it into the same folder and rename database.yml
  4. Open database.yml using Notepad
  5. Delete everything that is above # postgres information
  6. Uncomment the hashes from development and all its children all the way down; leave # production needs to be defined....
  7. delete the space before development; text; production
  8. delete the tab before the children of those and replace with two spaces
  9. Connect to dev.thlib.org with config from Ron for PGMyadmin
  10. In database.yml, in development section, change username to postgres
  11. below password, add port: 5433
  12. Go to ruby command line
  13. in thl-rails/places
  14. type: ruby script/server
  15. type: gem install ruby-debug
  16. type: gem install ruby-debug --no-ri --no-rdoc --platform=mswin32
  17. Download ruby-debug-base gem

from external link: http://rubyforge.org/frs/download.php/46863/ruby-debug-base- 0.10.3-mswin32.gem. Download it to C:some_location

  1. cd to the location on C: where you downloaded the file

gem install ruby-debug-base -l gem install ruby-debug gem install ruby-debug-ide -v 0.4.6 gem install pg gem install postgres-pr

  1. cd to thl-rails/places
  2. Run: ruby script/server
  3. run: gem install mongrel
  4. run: ruby script/server
  5. Open a browser and enter this URL: external link: http://localhost:3000
  6. Should open Place Dictionary in the browser
  7. Then you can add to URL for /features/### etc

places/vendor/plugins/places_engine/app/views/features/_feature.html.erb

  1. in database: thdl_places_environment

#

  1. /thl/places, there are three links:

git@github.com:thl/places.git Clone the places repository to your hard drive

Provided for unrestricted use by the external link: Tibetan and Himalayan Library