Code For Ror Apps In Git
<h3 class="heading-h6"><a name="THLToolboxhomegtDevelopersZonegtWebDevelopmentgtCodeforRoRAppsinGIT" class="anchorpoint"></a><a href="/tools/wiki/home.html">THL Toolbox</a> > <a href="/tools/wiki/Developers%27%20Zone.html">Developers' Zone</a> > <a href="/tools/wiki/Web%20Development.html">Web Development</a> > Code for RoR Apps in GIT</h3><p class="paragraph">
</p><h3 class="heading-h1"><a name="CodeforRoRAppsinGIT" class="anchorpoint"></a>Code for RoR Apps in GIT</h3><p class="paragraph">
<strong class="bold">Contributor(s):</strong> Andres Montano</p><p class="paragraph">All the THL Rails projects are in <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://github.com/thl" target="rwikiexternal">http://github.com/thl</a></span> (projects include both the applications and the plugins).
</p><h3 class="heading-h2"><a name="RailswithPostgres" class="anchorpoint"></a>Rails with Postgres</h3><p class="paragraph">
</p><ol><li>Download the installer from <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://code.google.com/p/msysgit/downloads/list" target="rwikiexternal">http://code.google.com/p/msysgit/downloads/list</a></span><ol><li>The current installer version for Windows is Git-1.7.3.1-preview20101002.exe</li></ol>
</li>
<li>Install GIT</li>
<li>Create an account on GitHub: <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://github.com/" target="rwikiexternal">http://github.com/</a></span></li></ol><p class="paragraph">To set up localhost to run Place Dictionary:
</p><ol><li>Launch Git Bash (should be a shortcut icon on your desktop)</li>
<li>Log in to GitHub at <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://github.com" target="rwikiexternal">http://github.com</a></span></li>
<li>Click on Need help with public keys link</li>
<li>Or, go to <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://help.github.com/msysgit-key-setup/" target="rwikiexternal">http://help.github.com/msysgit-key-setup/</a></span></li>
<li>Follow the instructions for generating a SSH public key</li>
<li>Follow the instructions for adding a key to your GitHub</li>
<li>Go back to <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="https://github.com/account" target="rwikiexternal">https://github.com/account</a></span></li></ol><p class="paragraph">Open id_rsa with a text editor; copy the public key and paste it into the Key box on <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="https://github.com/account" target="rwikiexternal">https://github.com/account</a></span></p><p class="paragraph">Install the Place Dictionary
</p><ol><li>On your hard drive, create a folder outside of subversion folders: thl-rails</li>
<li>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</li>
<li>Open GitBash and cd to the thl-rails folder you just created</li>
<li>Run the command: git clone git@github.com:thl/places.git</li>
<li>It will say: "cloning into places…"</li>
<li>Type yes in answer to are you sure you want to conintue connecting (yes/no)?</li>
<li>cd places (c:/thl-rails/places)</li>
<li>run the command: git submodule init</li>
<li>run the command: git submodule update</li>
<li>exit GitBash</li></ol><p class="paragraph">
</p><h3 class="heading-h2"><a name="InstallRuby" class="anchorpoint"></a>Install Ruby</h3><p class="paragraph">
</p><ol><li>Go to <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://rubyforge.org/frs/download.php/72085/rubyinstaller-1.8.7-p302.exe" target="rwikiexternal">http://rubyforge.org/frs/download.php/72085/rubyinstaller-1.8.7-p302.exe</a></span></li>
<li>Run the ruby installer</li>
<li>Click on Start Command prompt with Ruby from the Ruby folder</li>
<li>run: gem list (m,akes sure Ruby is installed properly)</li></ol><p class="paragraph">
</p><h3 class="heading-h2"><a name="InstallRails" class="anchorpoint"></a>Install Rails</h3><p class="paragraph">
</p><ol><li>In the Ruby command prompt window, run: gem install rails -v 2.3.4 --no-ri --no-rdoc --platform=mswin32</li></ol><p class="paragraph">
</p><h3 class="heading-h2"><a name="Installhpricot" class="anchorpoint"></a>Install hpricot</h3><p class="paragraph">
</p><ol><li>In the Ruby command prompt window, run: gem install hpricot --no-ri --no-rdoc --platform=mswin32</li></ol><p class="paragraph">
</p><ol><li>cd thl-rails/places/config</li>
<li>Run ls</li>
<li>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</li>
<li>Open database.yml using Notepad</li>
<li>Delete everything that is above # postgres information</li>
<li>Uncomment the hashes from development and all its children all the way down; leave # production needs to be defined....</li>
<li>delete the space before development; text; production</li>
<li>delete the tab before the children of those and replace with two spaces</li>
<li>Connect to dev.thlib.org with config from Ron for PGMyadmin</li>
<li>In database.yml, in development section, change username to postgres</li>
<li>below password, add port: 5433</li>
<li>Go to ruby command line</li>
<li>in thl-rails/places</li>
<li>type: ruby script/server</li>
<li>type: gem install ruby-debug</li>
<li>type: gem install ruby-debug --no-ri --no-rdoc --platform=mswin32</li>
<li>Download ruby-debug-base gem</li></ol><p class="paragraph">
from <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://rubyforge.org/frs/download.php/46863/ruby-debug-base-" target="rwikiexternal">http://rubyforge.org/frs/download.php/46863/ruby-debug-base-</a></span>
0.10.3-mswin32.gem. Download it to
C:some_location
</p><ol><li>cd to the location on C: where you downloaded the file</li></ol><p class="paragraph">
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
</p><ol><li>cd to thl-rails/places</li>
<li>Run: ruby script/server</li>
<li>run: gem install mongrel</li>
<li>run: ruby script/server</li>
<li>Open a browser and enter this URL: <img src="/" alt="external link: " title="external link"/><span class="nobr"><a href="http://localhost:3000" target="rwikiexternal">http://localhost:3000</a></span></li>
<li>Should open Place Dictionary in the browser</li>
<li>Then you can add to URL for /features/### etc</li></ol><p class="paragraph">places/vendor/plugins/places_engine/app/views/features/_feature.html.erb</p><p class="paragraph">
</p><ol><li>in database: thdl_places_environment</li></ol><p class="paragraph">#</p><ol><li>/thl/places, there are three links:</li></ol><p class="paragraph">
git@github.com:thl/places.git
Clone the places repository to your hard drive
</p><h3 class="heading-h6"><a name="ProvidedforunrestrictedusebythespanclassnobrimgsrcsakairwikitoolimagesicklearrowgifaltexternallinktitleexternallinkahrefhttpwwwthliborgtargetrwikiexternalTibetanandHimalayanLibraryaspan" class="anchorpoint"></a><em class="italic">Provided for unrestricted use by the <span class="nobr"><img src="/" alt="external link: " title="external link"/><a href="http://www.thlib.org" target="rwikiexternal">Tibetan and Himalayan Library</a></span></em></h3>