Skip to content

Commit

Permalink
Merge pull request #11973 from prathamesh-sonpatki/nokogiri-warning
Browse files Browse the repository at this point in the history
Add error message for including nokogiri in Gemfile for rake doc:guides
  • Loading branch information
senny committed Aug 26, 2013
2 parents c199580 + 2c02fc3 commit 55c9109
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions guides/rails_guides.rb
Expand Up @@ -39,6 +39,25 @@ def bundler?
exit 1 exit 1
end 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/markdown'
require "rails_guides/generator" require "rails_guides/generator"
RailsGuides::Generator.new.generate RailsGuides::Generator.new.generate

0 comments on commit 55c9109

Please sign in to comment.