Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JRuby 1.2, JRuby 1.3RC1
-
Fix Version/s: JRuby 1.3RC2
-
Component/s: Core Classes/Modules
-
Labels:None
-
Environment:Windows XP, Java JRE6
-
Number of attachments :
Description
This fails on Windows:
Pathname.new('C:/').relative_path_from(Pathname.new("C:
test"))
This came from my attempt to run script/generate during the RailsConf tutorial. Here's the full stack trace:
C:\cry>jruby -S script/generate controller test
c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/1.8/pathname.rb:711:in `relative_path_from': different prefix: "C:/" and "C:
cry" (Argument Error)
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:110:in `use_component_sources!'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:109:in `each'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:109:in `use_component_sources!'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:55:in `included'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator.rb:38
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator.rb:31:in `require'
from c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:2
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:31:in `require'
from c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:\cry\script\generate:3
Charles Nutter asked me to include this further debug output, which includes config/boot.rb outputting the value of RAILS_ROOT:
C:\cry>jruby script/generate migration blah2
"script/../config/.."
"C:/cry"
exists db/migrate
create db/migrate/20090504181152_blah2.rb
C:\cry>jruby -S script/generate migration blah2
"C:\\cry
script/../config/.."
"C:
cry"
c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/1.8/pathname.rb:711:in `relative_path_from': different prefix: "C:/" and "C:
cry" (Argument Error)
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:110:in `use_component_sources!'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:109:in `each'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:109:in `use_component_sources!'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:55:in `included'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator.rb:38
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator.rb:31:in `require'
from c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:2
from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:31:in `require'
from c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:\cry\script\generate:3
It looks like using the -S flag for the script/generate script was causing me problems.
script/../config/.." "C:
cry" c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/1.8/pathname.rb:711:in `relative_path_from': different prefix: "C:/" and "C:
cry" (Argument Error) from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:110:in `use_component_sources!' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:109:in `each' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:109:in `use_component_sources!' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator/lookup.rb:55:in `included' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator.rb:38 from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails_generator.rb:31:in `require' from c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require' from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:2 from C:/jruby/jruby-1.3.0RC1/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/generate.rb:31:in `require' from c:/jruby/jruby-1.3.0RC1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from C:\cry\script\generate:3 It looks like using the -S flag for the script/generate script was causing me problems.