E-TextEditor is a very useful tool in the world of Ruby on Rails. It combines a robust text editor with syntax highlighting for a large library of languages while also incorporating Cygwin (a UNIX shell for Windows) in order for you to build and execute code directly in the text editor.
E-TextEditor utilizes bundles, which allows for endless possibilities when it comes to support for languages and frameworks. E is similar to a program called TextMate that runs solely on the Mac, but thankfully programmers can enjoy a comparable experience on Windows. In fact, E-TextEditor runs many of TextMate’s bundles on Windows. This is all thanks to Cygwin. “Get that Linux feeling – on Windows!”
Below are the instructions for installing the trial version of E-TextEditor, but purchasing a copy is easy, and you can unlock the full version from within the the trial software.
All of the steps shown below were carried out on a Windows 7 Professional 64-bit system with Service Pack 1 installed.
- Download the E-TextEditor Free Trial installation file here: http://www.e-texteditor.com/
- Run the installer.
- Click “Next” on the initial installation screen.
- Accept the License Agreement and click “Next.”
- Leave the default installation path as it is and click “Next.”
- Customize the additional tasks you wish the installer to perform. It is recommended to leave the last two boxes checked (“Add ‘Edit with e’ to explorers right click menu” and “Add e command line tool to your system path”).
Click “Next” when ready to begin the installation.
- You will see the installation progress as below:
- Once the installation of E-TextEditor is complete, you will see the following. Click “Finish.”
- Now, open E-TextEditor from the Start menu.
- Upon the first run of E-TextEditor you will get the following dialog about installing Cygwin:
- Ensure that “Automatic” is checked and that you have an active internet connection, then click “OK.”
- The Cygwin installation process is a bit lengthy. During this you will see a window similar to the following:
- Once the Cygwin installation process completes, the dialog will just close. There is no confirmation message.
- You should now see the E-TextEditor window with a blank document in front of you.
- At the bottom, click where it says “Plain Text” to open the dialect menu. Select “Ruby” (not “Ruby on Rails”) from the list.
- In the main document window, type the following: puts ‘Hello World’
- Press Ctrl+R to run the program.
- It is very likely that you will see a big error message in the output window rather than the expected program output. If that is the case then proceed with the steps below. Otherwise, congratulations on writing your first Ruby program!
- Close E-TextEditor.
- Open a Windows command prompt:
- Press WindowsKey+R on the keyboard to open the Run dialog.
- Type “cmd” in the box and press the Enter key.
- Navigate to the Cygwin bin directory, which is most likely located in: C:\cygwin\bin. You’ll need to change into this directory using the cd command.
- Type ash.exe to run the shell.
- You should see a $ symbol at the start of the line.
- Type ./rebaseall and press the Enter key.
- Once this finishes and you see another $ on the next line, type exit and press the Enter key. Then close the command prompt window.
- Open the E-TextEditor program and (assuming your program code is still there) press Ctrl+R to run your program again.
- The program should now run correctly and you should see “Hello World” printed in the output section. Congratulations on your first successful Ruby program execution.
This concludes the setup process for E-TextEditor and Cygwin.