Ruby on Rails: "no such file or directory" with logger.rb

I am trying to run RoR application locally for the first time. I started the server and got the following error (after starting WEBrick):

C:/Ruby/lib/ruby/1.9.1/logger.rb:599:in `initialize': No such file or directory - /dev/null (Errno::ENOENT)

      

I am trying to run rake db: migrate and I get the same error:

    ** Execute environment
    rake aborted!
    No such file or directory - /dev/null
    C:/Ruby/lib/ruby/1.9.1/logger.rb:599:in `initialize'
    C:/Ruby/lib/ruby/1.9.1/logger.rb:599:in `open'
    C:/Ruby/lib/ruby/1.9.1/logger.rb:599:in `create_logfile'
    C:/Ruby/lib/ruby/1.9.1/logger.rb:594:in `open_logfile'
    C:/Ruby/lib/ruby/1.9.1/logger.rb:549:in `initialize'
    C:/Ruby/lib/ruby/1.9.1/logger.rb:314:in `new'
    C:/Ruby/lib/ruby/1.9.1/logger.rb:314:in `initialize'
    C:/Ruby/lib/ruby/gems/1.9.1/gems/activesupport-3.2.0/lib/active_support/core_ext/logger.rb:72:in `initialize'

      

I am running on a Windows machine if that helps. Does anyone know what's going on here?

> ruby -v
ruby 1.9.3p0 (2011-10-30) [i386-mingw32]

> rails -v
Rails 3.2.0

      

+1


source to share


2 answers


/ dev / null file is unix specific, there is no such file on Windows.



+2


source


To add to @farnoy's answer.

although from trace it looks like it might be popped from the rails or ruby ​​stack frame stack. This is usually caused by the application developer making incorrect assumptions about the environment.



in my case, some of the App script files are specifying '/ dev / null' as the log file, causing the cross platform to break.

just grep 'dev / null' in your app folder and change accordingly.

0


source







All Articles