mirror of
https://github.com/indentlabs/notebook.git
synced 2025-10-26 11:19:22 +00:00
Add require 'logger' to bin/webpack before requiring webpacker. The webpack script runs as a separate Ruby process and doesn't load Rails initializers, so the Logger fix needs to be applied directly in the script. This resolves the production compilation error: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
23 lines
561 B
Ruby
Executable File
23 lines
561 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
|
|
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
|
|
ENV["NODE_ENV"] ||= "development"
|
|
|
|
require "pathname"
|
|
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
Pathname.new(__FILE__).realpath)
|
|
|
|
require "bundler/setup"
|
|
|
|
# Fix for Ruby 3.2+ with Rails 6.1 and Webpacker
|
|
# Resolves: uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger
|
|
require "logger"
|
|
|
|
require "webpacker"
|
|
require "webpacker/webpack_runner"
|
|
|
|
APP_ROOT = File.expand_path("..", __dir__)
|
|
Dir.chdir(APP_ROOT) do
|
|
Webpacker::WebpackRunner.run(ARGV)
|
|
end
|