Skip to content

Instantly share code, notes, and snippets.

@metaskills metaskills/rails.md
Last active Feb 23, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.