![]() If you decide to use Sublime Text, you might want to follow the setup instructions for Rails Tutorial Sublime Text. A text editor/command line development environment (TextMate/iTerm). If developing within Windows itself, I recommend using the command prompt that comes with Rails Installer (Section 1.2.2).įigure 1.1. On Windows, many users prefer to develop Rails applications in a virtual machine running Linux, in which case your command-line options reduce to the previous case. Terminal: On OS X, I recommend either use iTerm or the native Terminal app.Sublime Text is a commercial product, whereas Vim is free and open-source both are industrial-strength editors, but Sublime Text is much more accessible to beginners. (TextMate, which is available only on OS X, is still a good choice if you use a Mac.) A second excellent choice is Vim, 8 versions of which are available for all major platforms. Sublime Text is heavily influenced by TextMate, and in fact is compatible with most TextMate customizations, such as snippets and color schemes. Text editor: I recommend Sublime Text 2, an outstanding cross-platform text editor that is in beta as of this writing but has already proven to be exceptionally powerful.Which combination you use depends on your tastes and your platform. Instead of using an IDE, I prefer to use a text editor to edit text, and a command line to issue commands ( Figure 1.1). 7 If you’re comfortable using an IDE, I suggest taking a look at the options mentioned to see what fits with the way you work. I’ve heard especially good things about RubyMine, and one reader (David Loeffler) has assembled notes on how to use RubyMine with this tutorial. There is no shortage of Rails IDEs, including RadRails, RubyMine, and 3rd Rail. ![]() Development EnvironmentsĬonsidering various idiosyncratic customizations, there are probably as many development environments as there are Rails programmers, but there are at least two broad types: text editor/command line environments, and integrated development environments (IDEs). It’s not just you every developer goes through it (often more than once), but rest assured that the effort will be richly rewarded. There is quite a bit of overhead here, especially if you don’t have extensive programming experience, so don’t get discouraged if it takes a while to get started. It’s time now to get going with a Ruby on Rails development environment and our first application. I think of Chapter 1 as the “weeding out phase” in law school-if you can get your dev environment set up, the rest is easy to get through.Next time I will discuss how the Ruby language itself, the APIs, and the IRB further lessen the dependence on IntelliSense.Ruby on Rails Tutorial: Learn Web Development with Rails, 2nd Edition RubyAMP is a powerful TextMate bundle that expands the Completion feature to include all the files in a project. You can jump around files in a project ( CMD + T) and between methods in a file ( CMD + SHIFT + T) easily. TextMate also has a help shortcut ( CTRL + H) that looks up the API documenation on any method you highlight. This is neat as it also helps you discover information about the API. Validates_length_of :attribute, :within => 3.20, :message => "must be present" For example, typing vl and TAB generates the following Rails code: For example, pressing def and TAB will generate a function definition: You can install Bundles (TextMate extension packages) to add snippets for popular frameworks such as Rails or RSpec. Typically you type the first 3 letters of a structure and then press TAB. Snippets generate commonly used Ruby and API structures quickly. This is simplistic compared to auto-complete in Visual Studio (as TextMate lacks any type information about the code) but it does save a lot of typing. Pressing ESC again will cycle through other potential matches. For example if I have a Ruby file like the following:Īnd I press ESC after the p, TextMate will expand the p to print, as print has appeared previously in the file (Other popular Ruby editors such as Emacs and Vim have similar features.) CompletionĬompletion works as follows: if you start typing a word and press the ESC key, TextMate will attempt to complete the word if it has appeared previously in the file. This has two features that give you 50% of what IntelliSense does: Completion and Snippets. Some Ruby IDEs such as JetBrains RubyMine do have Visual Studio style IntelliSense, but the majority of Ruby developers use TextMate as their primary editor. I have found that the combination of the powerful features of TextMate, quick feedback from the IRB, and the Ruby language reduce your dependence on IntelliSense. NET developers is how can Ruby development be productive without this feature? I am currently making the transition to Ruby myself. IntelliSense is a feature in the Visual Studio IDE that saves you a hell of a lot of typing and makes APIs discoverable.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |