# Migrations suddenly broken: undefined method autoload\_paths

**URL:** <https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107>\
**Category:** Rails\
**Created:** [August 10, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107 "2006-08-10T21:15:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [August 10, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107/1 "2006-08-10T21:15:12Z")

</div>

I really need some help here because I am at a loss. I have been using  
migrations just fine now for a while and I suddenly started getting a  
very bizarre error when migrations are run:

undefined method `autoload\_paths=’ for Dependencies:Module

I have tried rolling back my application code, and rolling back the  
rails edge revision I am running but neither seem to help.

I have installed the latest rails gems, even though I am running edge.  
I have even restarted our server. I just have no idea what to do next.

It should be noted that everything works just fine on my windows  
development machine.

Please someone help me figure out what is going on.

-Alex

[root@magneticworldinc mw]# rake db:migrate --trace  
(in /home/magneticworld)  
\*\* Invoke db:migrate (first\_time)  
\*\* Invoke environment (first\_time)  
\*\* Execute environment  
rake aborted!  
undefined method `autoload_paths=' for Dependencies:Module /home/magneticworld/config/../vendor/rails/railties/lib/initializer.rb:131:in`set\_autoload\_paths’  
/home/magneticworld/config/…/vendor/rails/railties/lib/initializer.rb:83:in  
`process' /home/magneticworld/config/../vendor/rails/railties/lib/initializer.rb:42:in`run’  
/home/magneticworld/config/…/config/environment.rb:10

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [August 14, 2006, 9:01pm UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107/2 "2006-08-14T21:01:46Z")

</div>

Hi Alex, is the below your full stack trace?

This happened to me, and when I ran rake with the trace, I noticed that  
it was using activerecord and activesupport from my /usr/local/lib  
folder and not my\_proj/vendor/rails (which is edge rails).  
Once I removed my rails installation from /usr/local/lib it worked as it  
used the activerecord and activesupport libs from vendor/rails.

Rails folks, what is the best way to totally remove a dependency on  
one’s /usr/local/lib binary and instead use the rails version in  
my\_proj/vendor/lib.

Thanks in Adv.  
Adam

> [root@magneticworldinc mw]# rake db:migrate --trace  
> (in /home/magneticworld)  
> \*\* Invoke db:migrate (first\_time)  
> \*\* Invoke environment (first\_time)  
> \*\* Execute environment  
> rake aborted!  
> undefined method `autoload_paths=' for Dependencies:Module /home/magneticworld/config/../vendor/rails/railties/lib/initializer.rb:131:in`set\_autoload\_paths’  
> /home/magneticworld/config/…/vendor/rails/railties/lib/initializer.rb:83:in  
> `process' /home/magneticworld/config/../vendor/rails/railties/lib/initializer.rb:42:in`run’  
> /home/magneticworld/config/…/config/environment.rb:10

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [August 14, 2006, 9:15pm UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107/3 "2006-08-14T21:15:24Z")

</div>

Adam wrote:

> Hi Alex, is the below your full stack trace?
> 
> This happened to me, and when I ran rake with the trace, I noticed that  
> it was using activerecord and activesupport from my /usr/local/lib  
> folder and not my\_proj/vendor/rails (which is edge rails).  
> Once I removed my rails installation from /usr/local/lib it worked as it  
> used the activerecord and activesupport libs from vendor/rails.
> 
> Rails folks, what is the best way to totally remove a dependency on  
> one’s /usr/local/lib binary and instead use the rails version in  
> my\_proj/vendor/lib.
> 
> Thanks in Adv.  
> Adam

Removing vendor/rails did allow me to migrate, I stumbled into that  
myself. But in order to do it I also have to comment out my  
map.resources calls or migrations crash when the rails is loading due to  
bad routes which are not yet supported in the gems. So it’s really big  
pain in the butt.

There is one line in the trace that does look like it is loading the  
dependency module from the gems, and not vendor:

/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active\_support/dependencies.rb:147:in  
`require’

I even tried uninstalling the rails gems and got “Could not find RubyGem  
activesupport (= 1.3.1)” so the gems must at least be there, even if  
they are out of date.

So what exactly is happening here?

here is the full trace:

=========================================================  
rake aborted!  
undefined method `autoload_paths=' for Dependencies:Module /home/magneticworld/config/../vendor/rails/railties/lib/initializer.rb:131:in`set\_autoload\_paths’  
/home/magneticworld/config/…/vendor/rails/railties/lib/initializer.rb:83:in  
`process' /home/magneticworld/config/../vendor/rails/railties/lib/initializer.rb:42:in`run’  
/home/magneticworld/config/…/config/environment.rb:10  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in`require’  
/home/magneticworld/config/…/vendor/rails/railties/lib/tasks/misc.rake:3

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [August 15, 2006, 12:52am UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107/4 "2006-08-15T00:52:15Z")

</div>

Adam wrote:

> wow… that was a bit hidden.
> 
> If you have any rake tasks that have a require statement, make sure  
> there are no leading or trailing spaces. If there are then you will see  
> that error.
> 
> obscure eh? 😉
> 
> also check your plugins as many of them have their own tasks.
> 
> Now I can sleep better at night 😉
> 
> Time to open up a bug for this one.

Awesome! The problem appeared to be a plugin that suddenly became  
incompatible with edge rails. The rails\_rcov plugin was crashing it. I  
couldnt find a require with spaces in it though.

Thanks for the tip to check out my plugins.

-Alex

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [August 15, 2006, 2:33am UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107/5 "2006-08-15T02:33:29Z")

</div>

hey Alex

I saw someone on IRC #rubyonrails had the same issue with that plugin.  
I haven’t used it, but it could also be that the code within the plugin  
is calling a module that has not been declared 'require’ed at the top of  
the file.

Nicholas states that spaces are not allowed. I guess this is an example  
of the logic just becoming tighter and more ‘in-line’ with ruby. A tad  
painful but it will probably be worth it.

> **[Reloading Revamped](https://rubyonrails.org/2006/8/11/reloading-revamped)**
>
> A few days ago I checked in a significant improvement to Rails’ dependencies and reloading code. In the past, changes to dependencies.rb have shed the blood of those courageous enough to ride edge; We’ve worked hard to prevent accidental breakage...

Adam

---

<div class="post-metadata">

**Author:** ![squeegy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/dec6dc/32.png) [@squeegy](https://www.ruby-forum.com/u/squeegy)\
**Post date:** [August 14, 2006, 11:42pm UTC](https://www.ruby-forum.com/t/migrations-suddenly-broken-undefined-method-autoload-paths/102107/6 "2006-08-14T23:42:46Z")

</div>

wow… that was a bit hidden.

If you have any rake tasks that have a require statement, make sure  
there are no leading or trailing spaces. If there are then you will see  
that error.

obscure eh? 😉

also check your plugins as many of them have their own tasks.

Now I can sleep better at night 😉

Time to open up a bug for this one.
