You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a race condition when requiring the cloudinary gem. cloudinary/railtie must be required aftercloudinary. If it's required during the load of cloudinary, then an exception is throw:
/Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/helper.rb:237:in `block in included': undefined method `config' for Cloudinary:Module (NoMethodError)
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/helper.rb:233:in `class_eval'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/helper.rb:233:in `included'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/railtie.rb:6:in `include'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/railtie.rb:6:in `block in <class:Railtie>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:36:in `call'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:28:in `block in on_load'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:27:in `each'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/lazy_load_hooks.rb:27:in `on_load'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/railties-4.1.6/lib/rails/railtie/configuration.rb:69:in `after_initialize'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/railtie.rb:5:in `<class:Railtie>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary/railtie.rb:1:in `<top (required)>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/cloudinary-1.0.77/lib/cloudinary.rb:12:in `<top (required)>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/lib/foo/bar.rb:1:in `<top (required)>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/test/lib/foo/bar_test.rb:1:in `<top (required)>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:10:in `block (2 levels) in <main>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:9:in `each'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:9:in `block in <main>'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:4:in `select'
from /Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib:lib:test" -I"/Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib" "/Users/john/dev/foo/path/ruby/2.1.0/gems/rake-10.3.2/lib/rake/rake_test_loader.rb" "test/**/*_test.rb" ]
If the condition is met there, and cloudinary/railtie is required, then CloudinaryHelper.included ends up running, as it's included in ActionView::Base. If the condition on line #237 of CloudinaryHelper.included gets to the last expression - Cloudinary.config.enhance_image_tag - an exception is raised, as Cloudinary.config has not been defined yet... it's defined later on in cloudinary.rb.
The text was updated successfully, but these errors were encountered:
There is a race condition when requiring the cloudinary gem.
cloudinary/railtie
must be required aftercloudinary
. If it's required during the load ofcloudinary
, then an exception is throw:See
cloudinary.rb
line 12:If the condition is met there, and
cloudinary/railtie
is required, thenCloudinaryHelper.included
ends up running, as it's included inActionView::Base
. If the condition on line #237 ofCloudinaryHelper.included
gets to the last expression -Cloudinary.config.enhance_image_tag
- an exception is raised, asCloudinary.config
has not been defined yet... it's defined later on incloudinary.rb
.The text was updated successfully, but these errors were encountered: