Skip to content

Can't run rails if jruby's path contains whitespaces #3878

@ahorek

Description

@ahorek

Environment

jruby 9.1.1.0-SNAPSHOT (2.3.0) 2016-05-11 9a2310a Java HotSpot(TM) 64-Bit Server VM 25.25-b02 on 1.8.0_25-b18 +jit [mswin32-x86_64]

Expected Behavior

no exception

Actual Behavior

rails is trying to load Gem.ruby path which is double quoted if the path contains whitespaces
then withExeSuffix(fname) method returns false even if the suffix is present
and it ends up with paths like this one "C:/jruby test/jruby/bin/jruby.exe".exe

https://github.com/jruby/jruby/blob/master/core/src/main/java/org/jruby/util/ShellLauncher.java#L360

C:\jruby test\jruby\bin\jruby.exe -S rails s

Errno::ENOENT: No such file or directory - "C:/jruby test/jruby/bin/jruby.exe"
           _exec_internal at org/jruby/RubyKernel.java:1635
                     exec at uri:classloader:/jruby/kernel/kernel.rb:17
  block in exec_app_rails at C:/jruby test/jruby/lib/ruby/gems/shared/gems/railties-4.2.5.2/lib/rails/app_rails_loader.rb:41
                     loop at org/jruby/RubyKernel.java:1290
           exec_app_rails at C:/jruby test/jruby/lib/ruby/gems/shared/gems/railties-4.2.5.2/lib/rails/app_rails_loader.rb:34
                    <top> at C:/jruby test/jruby/lib/ruby/gems/shared/gems/railties-4.2.5.2/lib/rails/cli.rb:5
                  require at org/jruby/RubyKernel.java:944
                   (root) at C:/jruby test/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:1
                    <top> at C:/jruby test/jruby/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:69
                     load at org/jruby/RubyKernel.java:962
                    <top> at C:/jruby test/jruby/bin/rails:23

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions