diff options
-rw-r--r-- | guides/source/initialization.textile | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/guides/source/initialization.textile b/guides/source/initialization.textile index b5e427b35c..69e5c1edcc 100644 --- a/guides/source/initialization.textile +++ b/guides/source/initialization.textile @@ -21,24 +21,14 @@ 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. -# -require 'rubygems' - -version = ">= 0" - -if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then - version = $1 - ARGV.shift +begin + require "rails/cli" +rescue LoadError + railties_path = File.expand_path('../../railties/lib', __FILE__) + $:.unshift(railties_path) + require "rails/cli" 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. |