Skip to content

Instantly share code, notes, and snippets.

@metaskills
Last active February 23, 2017 00:56
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 metaskills/28827a967a6c68ab8eed0f720fb8e156 to your computer and use it in GitHub Desktop.
Save metaskills/28827a967a6c68ab8eed0f720fb8e156 to your computer and use it in GitHub Desktop.
Step ?) Create Rails Application
$ gem install rails
$ rails new my_application --database=sqlserver
$ cd my_application

<TEMPORARY-HACKS>

This section is obsolete when Rails v5.0.2 comes out. Open the config/database.yml and change the contents to look like this.

default: &default
  adapter: sqlserver
  encoding: utf8
  username: sa
  password: <%= ENV['SA_PASSWORD'] %>
  host: localhost

development:
  <<: *default
  database: my_application_development

test:
  <<: *default
  database: my_application_test

</TEMPORARY-HACKS> Just FYI.

Now setup your development and test databases.

$ export SA_PASSWORD=...
$ ./bin/setup

From here you can start your Rails server and load the initial welcome to Rails test page.

$ ./bin/rails server
=> Booting Puma
=> Rails 5.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.7.1 (ruby 2.3.1-p112), codename: Snowy Sagebrush
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

Now visit http://localhost:3000 in youer browser. You should see the following page load.

Yay! You're on Rails!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment