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.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/guides/rails_guides.rb b/guides/rails_guides.rb
index ce409868ca..9d488a8a15 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
@@ -39,6 +39,25 @@ 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 Nokogiri.')
+ $stderr.puts(<<ERROR) if bundler?
+Please add
+
+ gem 'nokogiri'
+
+to the Gemfile, run
+
+ bundle install
+
+and try again.
+ERROR
+ exit 1
+end
+
require 'rails_guides/markdown'
require "rails_guides/generator"
RailsGuides::Generator.new.generate