Skip to content

Commit ee68523

Browse files
committed
Added errors for understanding require problems in rabl and jbuilder
1 parent 060ea40 commit ee68523

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/gon.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,18 @@ def clear
4848
end
4949

5050
def rabl(*args)
51+
unless Gon.constants.include?(:Rabl)
52+
raise "Possible wrong require order problem - try to add `gem 'rabl'` before `gem 'gon'` in your Gemfile"
53+
end
5154
data, options = Gon::Rabl.handler(args)
5255

5356
store_builder_data 'rabl', data, options
5457
end
5558

5659
def jbuilder(*args)
60+
unless Gon.constants.include?(:Jbuilder)
61+
raise "Possible wrong require order problem - try to add `gem 'jbuilder'` before `gem 'gon'` in your Gemfile"
62+
end
5763
data, options = Gon::Jbuilder.handler(args)
5864

5965
store_builder_data 'jbuilder', data, options

0 commit comments

Comments
 (0)