Skip to content

Instantly share code, notes, and snippets.

@rip747
Last active March 16, 2019 16:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rip747/d29d5545b08591ba078ada474165f3b2 to your computer and use it in GitHub Desktop.
Save rip747/d29d5545b08591ba078ada474165f3b2 to your computer and use it in GitHub Desktop.
Rails on Windows: My Notes
Follow the instructions for installing Rails on Windows from this site:
https://medium.com/ruby-on-rails-web-application-development/how-to-install-rubyonrails-on-windows-7-8-10-complete-tutorial-2017-fc95720ee059
Note your comments:
https://medium.com/@karalootzkoding/excellent-tutorial-here-is-a-list-of-things-that-i-encountered-while-following-it-and-then-after-eba00bb3108e
do: gem install sqlite3 — platform=ruby -v 1.3.13
use the following in your Gemfile:
gem ‘sqlite3’, git: “https://github.com/larskanis/sqlite3-ruby", branch: “add-gemspec”
Install the HTTPPlatformHandler 1.2 NOTE: that this one works with Windows 10:
https://www.iis.net/downloads/microsoft/httpplatformhandler#additionalDownloads
Use the web.config file below in order to get the site working on IIS
To get SQL server working, you need the following gems. NOTE: you HAVE to specify the activerecord-sqlserver-adapter version as the default on is 2.3.8 and DOES NOT WORK.
gem 'tiny_tds'
gem 'activerecord-sqlserver-adapter', '5.2.0.rc2'
Multiple Databases with Rails
https://www.thegreatcodeadventure.com/managing-multiple-databases-in-a-single-rails-application/
Using GUID's As Primary Keys
https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-GUID's-As-Primary-Keys
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add
name="httpplatformhandler"
path="*"
verb="*"
modules="httpPlatformHandler"
resourceType="Unspecified"
requireAccess="Script" />
</handlers>
<!--
Obviously you need to change the paths to point to your install of Ruby and your site location
Please note: I would leave stdoutLogEnabled set to `true` until you can see your site, then set
it to false
-->
<httpPlatform
stdoutLogEnabled="false"
stdoutLogFile="F:\websites\iistest\rails.log"
startupTimeLimit="20"
processPath="C:\Ruby253\bin\ruby.exe"
arguments="&quot;F:\websites\iistest\bin\rails&quot; server -p %HTTP_PLATFORM_PORT% -b 127.0.0.1">
<environmentVariables>
<!--
Set the HOME environment variable to the same directory as when your site is.
This will prevent the following error:
HOME environment variable (or HOMEDRIVE and HOMEPATH) must be set and point to a directory (RuntimeError)
-->
<environmentVariable name="HOME" value="F:\websites\iistest"/>
<!-- so you can change the enironment here: development, production, test -->
<environmentVariable name="RAILS_ENV" value="development"/>
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment