Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails server can't be started because of the log problem #8

Closed
tony612 opened this issue Jul 19, 2017 · 4 comments
Closed

Rails server can't be started because of the log problem #8

tony612 opened this issue Jul 19, 2017 · 4 comments
Labels

Comments

@tony612
Copy link

tony612 commented Jul 19, 2017

After my Rails project is compiled, an error is raised when I try to start the server

$ ./a.out s
/__enclose_io_memfs__/lib/ruby/2.4.0/open-uri.rb:37:in `initialize': No such file or directory @ rb_sysopen - /__enclose_io_memfs__/local/log/development.log (Errno::ENOENT)
	from /__enclose_io_memfs__/lib/ruby/2.4.0/open-uri.rb:37:in `open'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/open-uri.rb:37:in `open'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:752:in `create_logfile'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:746:in `rescue in open_logfile'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:743:in `open_logfile'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:736:in `set_dev'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:671:in `initialize'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:387:in `new'
	from /__enclose_io_memfs__/lib/ruby/2.4.0/logger.rb:387:in `initialize'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/bundler/gems/lls_logger-ffb74f91993e/lib/lls_logger/file_logger.rb:4:in `initialize'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/bundler/gems/lls_logger-ffb74f91993e/lib/lls_logger.rb:19:in `new'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/bundler/gems/lls_logger-ffb74f91993e/lib/lls_logger.rb:19:in `new'
	from /__enclose_io_memfs__/local/config/initializers/logger.rb:17:in `<top (required)>'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `block in require'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:240:in `load_dependency'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/activesupport-4.2.8/lib/active_support/dependencies.rb:274:in `require'
	from /__enclose_io_memfs__/local/config/application.rb:13:in `<class:Application>'
	from /__enclose_io_memfs__/local/config/application.rb:12:in `<module:Neo>'
	from /__enclose_io_memfs__/local/config/application.rb:11:in `<top (required)>'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:78:in `require'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:78:in `block in server'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:75:in `tap'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:75:in `server'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /__enclose_io_memfs__/local/vendor/bundle/ruby/2.4.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in `<top (required)>'
	from /__enclose_io_memfs__/local/bin/rails:4:in `require'
	from /__enclose_io_memfs__/local/bin/rails:4:in `<main>'

The lls_logger is a logging gem, lls_logger-ffb74f91993e/lib/lls_logger/file_logger.rb:4 is like:

module LlsLogger
  class FileLogger < ::Logger
    def initialize(tag, log_dir: 'log')
      super(File.join(log_dir, "#{tag}.log"))
    end
  end
end
@pmq20
Copy link
Owner

pmq20 commented Jul 19, 2017

@tony612 Try adding this line at the top of your config/initializers/logger.rb:

Dir.mkdir('/__enclose_io_memfs__/local/log')

I am guessing that this is due to in part of the compiling process we deleted log and tmp folders, expecting a new one to be created at a temporary location in runtime. Cf. compiler.rb

image

@pmq20
Copy link
Owner

pmq20 commented Jul 19, 2017

tmp and log folder issues has been fixed in 0384f89.

Still have other issues. Seems like creation of log files inside log folder failed. It should be redirected to a temporary location. Let me fix it ASAP.

image

@tony612
Copy link
Author

tony612 commented Jul 19, 2017

👍

@tony612 tony612 closed this as completed Jul 19, 2017
@pmq20 pmq20 reopened this Jul 19, 2017
@pmq20 pmq20 closed this as completed in b128a9f Jul 19, 2017
@pmq20
Copy link
Owner

pmq20 commented Jul 19, 2017

The other issues got fixed in b128a9f

@pmq20 pmq20 added the bug label Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants