Maaaaaaaaaaaaajor sanity check needed.
I wrote a simple little plugin, and it wouldn’t load. I put some
comments
in it’s init.rb, and it didn’t even spit those out. So, I dug into the
initializer.rb (/vendor/rails/railties/lib/initializer.rb) to see wtf is
going on, and found the problem… but… can’t explain it. Here is the
code in question:
I’ve loaded the same situation up in IRB, and it works fine. Why is
File.file?(init_path) returning false !?
Permissions are fine, the path is fine:
public/…/config/…/vendor/plugins/my_plugin/init.rb.
So, I was able to hack this to work when I “hardcode” my absolute path
in
here… however, that is obviously the biggest hack ever.
Problem is, the path it’s getting from #{RAILS_ROOT} is a relative path,
and
when it’s being applied within the context of the initializer.rb
directory
(which is actually in the /vendor/ directory), it’s not a valid URL
anymore.
So, it looks as if you’re running Edge, and want plugins to work, your
out
of luck.
Am I crazy ?
Dylan… don’t know if this will help you here or not, but I was
commenting on the strange
relative path that RAILS_ROOT produces and Kris L. pointed out that
one can do
“File.expand_path(RAILS_ROOT)” to get the full path.