aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
Diffstat (limited to 'guides')
-rw-r--r--guides/source/initialization.textile22
1 files changed, 16 insertions, 6 deletions
diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile
index 69e5c1edcc..b5e427b35c 100644
--- a/guides/source/initialization.textile
+++ b/guides/source/initialization.textile
@@ -21,14 +21,24 @@ The actual +rails+ command is kept in _bin/rails_:
<ruby>
#!/usr/bin/env ruby
+#
+# This file was generated by RubyGems.
+#
+# The application 'railties' is installed as part of a gem, and
+# this file is here to facilitate running it.
+#
-begin
- require "rails/cli"
-rescue LoadError
- railties_path = File.expand_path('../../railties/lib', __FILE__)
- $:.unshift(railties_path)
- require "rails/cli"
+require 'rubygems'
+
+version = ">= 0"
+
+if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then
+ version = $1
+ ARGV.shift
end
+
+gem 'railties', version
+load Gem.bin_path('railties', 'rails', version)
</ruby>
This file will attempt to load +rails/cli+. If it cannot find it then +railties/lib+ is added to the load path (+$:+) before retrying.