aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--railties/guides/rails_guides.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/railties/guides/rails_guides.rb b/railties/guides/rails_guides.rb
index e6f0b694a6..dfbb06cc76 100644
--- a/railties/guides/rails_guides.rb
+++ b/railties/guides/rails_guides.rb
@@ -1,6 +1,13 @@
pwd = File.dirname(__FILE__)
$:.unshift pwd
+# This is a predicate useful for the doc:guides task of applications.
+def bundler?
+ # Note that rake sets the cwd to the one that contains the Rakefile
+ # being executed.
+ File.exists?('Gemfile')
+end
+
# Loading Action Pack requires rack and erubis.
require 'rubygems'
@@ -20,7 +27,19 @@ begin
gem 'RedCloth', '>= 4.1.1'
require 'redcloth'
rescue Gem::LoadError
- $stderr.puts %(Generating Guides requires RedCloth 4.1.1+)
+ $stderr.puts('Generating guides requires RedCloth 4.1.1+.')
+ $stderr.puts(<<ERROR) if bundler?
+Please add
+
+ gem 'RedCloth', '>= 4.1.1'
+
+to the Gemfile, run
+
+ bundle install
+
+and try again.
+ERROR
+
exit 1
end