Install Ruby on Rails on Windows guide

Install Ruby on Rails on Windows guide

I played around with Ruby on Rails and wanted to set up a developer environment with Rails server and Ruby, but didn’t find any straight forward and easy guides, so I wrote one instead. Following this guide you’ll get going developing and running Ruby in 10 minutes.

Download RubyInstaller and Dev kit from http://rubyinstaller.org/downloads/
If you run 64 bit, remember to get the 64 bit version of both Ruby and dev kit.

Install Rubyinstaller to C:\Ruby
Check “Install Tcl/Tk support”, “Add Ruby executables to your PATH” and “Assosiacte .rb and .rbw files with this Ruby installation”.

Install Ruby on Rails on Windows guide 01

Extract Dev kit to C:\Ruby\DevKit
Open Command Prompt and CD to C:\Ruby\DevKit

Run:

ruby dk.rb init

Install Ruby on Rails on Windows guide 02

Open C:\Ruby\DevKit\config.yml and ensure your Ruby location is included. It’s important that you have a “-” before the path like in the example. Save the file and go back to your Command Prompt.

Install Ruby on Rails on Windows guide 03

Run:

ruby dk.rb install

Install Ruby on Rails on Windows guide 04

Run:

gem install rails --no-rdoc --no-ri

Install Ruby on Rails on Windows guide 05

Create the directory C:\RubyApps

Install Ruby on Rails on Windows guide 06

CD to C:\RubyApps

Run:

rails new my_app

Install Ruby on Rails on Windows guide 07

If you installed the 64 bit version of Ruby, open C:\RubyApps\my_app\Gemfile and replace the tzinfo-data line with:

gem 'tzinfo-data', platforms: [:x64_mingw, :mingw, :mswin]

. Save the file and return to Command Prompt

Install Ruby on Rails on Windows guide 08

CD to C:\RubyApps\my_app

Run:

bundle update

Install Ruby on Rails on Windows guide 09

You are now done and can run your Rails server
Run:

rails server

Install Ruby on Rails on Windows guide 10

Open up a browser and go to:

http://localhost:3000

Install Ruby on Rails on Windows guide 11

That’s it. Your rails server is running in the Command Prompt window which is handy for development. There are many ways to make Rails run as a Windows Service, in Apache, IIS, etc. Google it if needed. :)

To get started developing your first Ruby application, I highly recommend this guide by Andrea Pavoni.

I found RubyMine by JetBrains to be a very nice IDE for developing Ruby on Rails applications – check it out.

RubyMine

Enable WCF Windows Server 2012

If you didn’t install HTTP-Activation for WCF Services, you will get a 404 error when trying to access your service directly.
To be able to run HTTP WCF Services, do as follows:

1. Run Server Manager from your task bar or start menu
2. Choose the server you want to install WCF on
3. Scroll down to “Roles and Features” from task drop down
4. On “Add Role or Feature Wizard” dialog, click down to “Features” in the list of pages on the left
5. Expand “.NET 4.5” – if you haven’t installed it already, go back to “roles” and install it first
6. Under WCF Services” check the box “HTTP-Activation”. You can also add other types (TCP, Named Pipes, etc) if you will need them
7. Click “Install”

Enable WCF Windows Server 2012

Fastest way to delete large folders in Windows

Deleting a folder with thousands or even millions of subfolders and files can be a rather slow process in Windows. Deleting the files normally from the GUI, requires you to empty the recycle bin afterwards, which takes quite some time too. Shift-deleting is faster than deleting and emptying the recycle bin, but also takes a lot of time, as Windows will first index all the files that need to be deleted.

The fastest way to delete folders and files is to make a bat-file with the following 2 lines, specifying what folder you want to delete.

Using this method rather than deleting from the GUI or using “rmdir /s/q foldername” can save you hours of waiting time, depending on your folder/file structure.

del /f/s/q foldername > nul
rmdir /s/q foldername

Configure / demote Active Directory Windows Server 2012

This tutorial will explain how to install and configure Active Directory (AD DS) under Windows Server 2012
http://sharepointgeorge.com/2012/configuring-active-directory-ad-ds-in-windows-server-2012/

Configure Active Directory Windows Server 2012

If you by accident configured you Active Directory (AD) with a wrong domain controller, you can demote / remove if by navigating to server roles > Remove Roles and Features > Active Directory Domain Services > Next, and you’ll be prompted with a validation error, where you can click “Demote this domain controller”. Choose this option and run the wizard. This will not uninstall the Active Directory service itself, but only the installed domain controller (domain.com).
http://techibee.com/active-directory/demoting-a-active-directory-domain-controller-in-windows-2012/1836