ProblemYou want to download and run the latest, pre-release version of Rails, known as Edge Rails. SolutionFrom the root of your Rails application, type: $ rake rails:freeze:edge When that command finishes, restart your server, and you'll be running your application on Edge Rails. If your project is under revision control with Subversion, you can take advantage of Subversion's externals definitions to instruct it to fetch the contents of a specified subdirectory from a separate repository. To do this, set the svn:externals property with the svn propedit command: $ svn propedit svn:externals vendor svn propedit opens your default editor (as indicated by the EDITOR environment variable) on an empty page. In that page, type the following value for svn:externals: rails http://dev.rubyonrails.org/svn/rails/trunk/ When you save the file and exit the editor, you'll see the message: Set new value for property 'svn:externals' on 'vendor' You then want to check in the property change you just made on the vendor directory and optionally verify that the property was set: $ svn ci -m 'modified externals on vendor to fetch from the Rails trunk' Sending vendor Committed revision 4. $ svn proplist --verbose vendor Properties on 'vendor': svn:externals : rails http://dev.rubyonrails.org/svn/rails/trunk/ With the externals property set on vendor, the next time you update your project with svn, the vendor directory will pull down the latest Rails version from the trunk: $ svn update DiscussionEdge Rails is the term used for the latest, most cutting-edge version of Rails. (In other words, the version that's currently under development by the Rails core team.) Normally, a new Rails application uses the Rails packages in the gem path of your Ruby installation. The rake rails:freeze:edge command performs a Subversion export of the last version of Rails from the public subversion repository (http://dev.rubyonrails.org/svn/rails/trunk). A Subversion export (svn export) downloads all the project files from a repository, without any of the Subversion meta-information (.svndirectories) that would be included with a svn checkout. The downloaded Rails packages are placed in vendor/rails of your project directory. The next time your server is restarted, the Rails version installed in vendor/rails will be used instead of the version located in your system's gem path. Running Edge Rails is a great way to preview what is likely to be included in the next public release of Rails. The code is usually pretty stable, but there are no guarantees about how the API might change in the future. One way to cope with unanticipated API changes is to have a thorough suite of tests for your application. If you download the latest Edge Rails, and any of your tests fail, you can revert to a previous version of Edge by specifying the Subversion revision number in the rails:freeze:edge command. For example, the following command reverts to Version 3495: $ rake rails:freeze:edge REVISION=3495 This command starts by removing the vendor/rails directory (if one exists), and then it downloads the specified revision from the Rails Subversion repository. You can also checkout a specific version of Edge by specifying a tag; for instance, you can checkout Rails 1.1.2 with: $ rake rails:freeze:edge TAG=rel_1-1-2 If your application has been running Edge Rails, and you would rather it use the Rails packages and gems in your system's Ruby installation, you can run: $ rake rails:unfreeze This simply removes the vendor/rails directory, letting your application run under the version of your system's Rails installation. If you are using Mac OS X or a GNU/Linux-like environment, you can quickly and easily swap between multiple versions of Edge Rails or freeze/unfreeze your Rails application even when you don't have Internet access. To do this, you have to checkout each Edge Rails version you need into its own directory. Then, if you want to freeze your Rails application to run against a particular version of Edge Rails, just symlink that version's directory to vendor/rails, and restart your server. To go back to your regular Rails version, simply remove the symlink and restart the server again. See Also
|