aboutsummaryrefslogtreecommitdiffstats
path: root/guides/rails_guides.rb
diff options
context:
space:
mode:
Diffstat (limited to 'guides/rails_guides.rb')
-rw-r--r--guides/rails_guides.rb27
1 files changed, 23 insertions, 4 deletions
diff --git a/guides/rails_guides.rb b/guides/rails_guides.rb
index ab890f202c..9d1d5567f6 100644
--- a/guides/rails_guides.rb
+++ b/guides/rails_guides.rb
@@ -5,7 +5,7 @@ $:.unshift pwd
def bundler?
# Note that rake sets the cwd to the one that contains the Rakefile
# being executed.
- File.exists?('Gemfile')
+ File.exist?('Gemfile')
end
begin
@@ -22,13 +22,32 @@ end
begin
require 'redcarpet'
-rescue Gem::LoadError
+rescue LoadError
+ # This can happen if doc:guides is executed in an application.
+ $stderr.puts('Generating guides requires Redcarpet 3.1.2+.')
+ $stderr.puts(<<ERROR) if bundler?
+Please add
+
+ gem 'redcarpet', '~> 3.1.2'
+
+to the Gemfile, run
+
+ bundle install
+
+and try again.
+ERROR
+ exit 1
+end
+
+begin
+ require 'nokogiri'
+rescue LoadError
# This can happen if doc:guides is executed in an application.
- $stderr.puts('Generating guides requires Redcarpet 2.1.1+.')
+ $stderr.puts('Generating guides requires Nokogiri.')
$stderr.puts(<<ERROR) if bundler?
Please add
- gem 'redcarpet', '~> 2.1.1'
+ gem 'nokogiri'
to the Gemfile, run