I'm running into an issue with the portion of the Rails generation script that searches the plugin path for appropriately named files to find generators. On one of my systems, I have Ruby installed in c:\dev\ruby
and have my project directory at d:\local\projects
The Ruby Pathname#relative_path_from
method (which is called by the Rails generator script) chokes on this configuration when it attempts to find the relative path between c:\
and d:\
...
Has anyone run into this situation with relative_path_from
and multiple drives on Windows? Is there a workaround for the rails generator script?
Here's a sample from IRB:
>> x = Pathname.new('c:/dev/ruby')
=> #<Pathname:c:/dev/ruby>
>> y = Pathname.new('d:/local/projects')
=> #<Pathname:d:/local/projects>
>> x.relative_path_from(y)
ArgumentError: different prefix: "c:/" and "d:/local/projects"
from c:/dev/ruby/lib/ruby/1.8/pathname.rb:709:in `relative_path_from'
from (irb)...
If there's no solution, I could always make sure my Ruby install and project directories are on the same drive, but that would prevent me from ever working off a project directory on a pendrive...
UPDATE: Turns out the issue is related specifically to some modification that the Radiant CMS makes to the Rails configuration variables. This change adds additional plugin directories to the project, some of which can cross drive boundaries. Since the Rails generator code doesn't expect that sort of drive-jumping, the generator breaks on my computer...