Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Errno::ENOENT: No such file or directory - C:/dev/null when executing jar command on windows #247

Closed
rob99 opened this issue Sep 2, 2016 · 3 comments
Labels

Comments

@rob99
Copy link

rob99 commented Sep 2, 2016

Torquebox 4 beta 3, JRuby 9.1.2.0

 C:\scripts\app>bundle exec torquebox jar
 19:09:10.670 INFO  Bundling gem dependencies
 Errno::ENOENT: No such file or directory - C:/dev/null
  initialize at org/jruby/RubyFile.java:360
        open at org/jruby/RubyIO.java:1129
       <top> at <script>:1
             at :1
             at :1
        load at org/jruby/RubyKernel.java:962
       <top> at C:\NotBackedUp\brownr12\downloads\jruby-9.1.2.0\bin\torquebox:22

I can see at https://github.com/torquebox/torquebox/blob/master/core/lib/torquebox/cli/jar.rb#L327 we check the PLATFORM constant for mswin however when using jruby this constant will always return java

I have hacked my gem to change this line to:

dev_null = 'NUL'

... now I don't get any error but I don't get any jar.

@rob99
Copy link
Author

rob99 commented Sep 2, 2016

I was able to move past the error by commenting the following lines out of cli/jar.rb

   # unless %W(DEBUG TRACE).include?(TorqueBox::Logger.log_level)
      # dev_null = PLATFORM =~ /mswin/ ? 'NUL' : '/dev/null'
      # ruby.evalScriptlet("$stdout = File.open('#{dev_null}', 'w')")
    # end

@bbrowning bbrowning added the 4x label Sep 15, 2016
@micred
Copy link

micred commented Nov 28, 2016

Same problem here.
Have you made a fork?

The strange thing is that my Rails conf is config.log_level = :debug so it should not go inside that block.
Why do I have TorqueBox::Logger.log_level = INFO even if Rails log level is DEBUG?

@rob99
Copy link
Author

rob99 commented Dec 10, 2016

No fork from me as yet. I only know how to get around it for myself, not sure how not break it for others,. Also not exactly sure what this is trying to do in the first place.

Note: your rails log level is different to you torquebox log level - they are different logs, by default.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants