grape icon indicating copy to clipboard operation
grape copied to clipboard

Circular dependency detected while autoloading constant

Open taromurao opened this issue 13 years ago • 9 comments

I got "Circular dependency detected while autoloading constant".

I removed config.autoload_paths += Dir["#{Rails.root}/app/api/*"] from application.rbthen it started to work again.

If anybody else had the same issue, it makes sense to update the README.md.

I am using Rails 4.0.1.

taromurao avatar Nov 07 '13 15:11 taromurao

I'm having the same issue but do not have that file on my application.rb. what do you think the problem could be? I am using Rails 4.0.0.

13tjc avatar Nov 26 '13 21:11 13tjc

I just re-typed my helper module and it started working may be it was a syntax error

13tjc avatar Nov 26 '13 21:11 13tjc

which helper was it?

slickpk avatar Jan 30 '14 20:01 slickpk

Same here, trying to figure it out now.

jure avatar Apr 03 '14 11:04 jure

+1

codespore avatar Jun 25 '14 11:06 codespore

+1. Same bug after updating to 4.1 from 4.0

kirillplatonov avatar Aug 06 '14 08:08 kirillplatonov

Rails 4.1.1, Grape 0.8.0 My API class - TwitterAPI I got that error after edit file from api/ folder I changed this

ActiveSupport::Dependencies.explicitly_unloadable_constants << "TwitterAPI"

to this:

ActiveSupport::Dependencies.explicitly_unloadable_constants << "AppName::TwitterAPI"

where AppName - application module from application.rb, and now its OK

artem-russkikh avatar Aug 09 '14 11:08 artem-russkikh

I just ran into the same issue locally after upgrading to Rails 4. I removed the Rails 3.x hack to reload the API and apply changes and it works fine again.

taratatach avatar Nov 25 '14 02:11 taratatach

I don't think this is a grape issue per-se, so I am going to close. We definitely need to improve the reloading instructions documentation, which is https://github.com/intridea/grape/pull/658 which would be nice if someone could please finish.

dblock avatar Nov 29 '14 15:11 dblock