Closed hachi8833 closed 8 months ago
@elia This seems like it would impact jsbundling-rails and cssbundling-rails as well. What do you think we should do?
@flavorjones I tried a few options, looks like adding RUBY_DEBUG_LAZY=true
as an export
in bin/dev
or as an env
in Procfile.dev
also fixes the issue, at least until a debugger session is started.
That to me looks like the easiest for both worlds, fixing the happy path.
I'm not sure how to fix the tmpdir
permission issue in the docker environment or if exposing a port could be enough, but once someone figures out the issue I guess the solution could be built into the default.
@flavorjones @hachi8833
I just opened https://github.com/rails/tailwindcss-rails/pull/292, please let me know if anyone wants to help porting it to other bundling repos, otherwise I'll do it once it's merged.
I've merged #292. Will cut a release shortly! :heart:
Symptom
Recently I got stuck with an issue that any newly generated Rails 7.1.x apps with tailwindcss-rails for running within a Docker container always break when running with
bin/dev
:The error
Invalid argument @ rb_file_s_lstat - /app/ruby-debug-sock-0/ruby-debug-UnknownUser-8 (Errno::EINVAL)
loops indefinitely and creates the following redundant directoryruby-debug-sock-0
for debugging:Steps to reproduce
Docker setup is required in your environment.
gem install dip
to install dip tool: https://github.com/bibendi/dipbundle init
)dip bundle install
dip bundle exec rails new . -c tailwind
, answering 'yes' to the prompt for overwriting Gemfiledip dev
(equivalent to runbin/dev
)Expected behavior: Rails starts normally. Actual behavior: Debugger emits the errors as above indefinitely.
Survey
I finally found that at least the recent change (adding
env RUBY_DEBUG_OPEN=true
) in https://github.com/rails/tailwindcss-rails/pull/281 is a trigger of the issue.Workaround
We can have some workarounds such as:
env RUBY_DEBUG_OPEN=true
from Procfile.devdebug
gem in Gemfilerequire: false
todebug
gem in GemfileProposition
As shown above, the added
env RUBY_DEBUG_OPEN=true
disturbs generating new Rails app for Docker container.While we have some workarounds as above, I think the benefit of adding
env RUBY_DEBUG_OPEN=true
as a default is at least limited and perhaps an overkill. I believe that purely generated Rails app with tailwindcss-rails should run normally in Docker container, without any tweaks.So I hope you'd remove
env RUBY_DEBUG_OPEN=true
from Procfile.dev until the issue of debug gem and Docker is resolved. I guess just adding a description to activateenv RUBY_DEBUG_OPEN=true
on README so that users can manually activate remote debugging is sufficient for a while.cc @duduribeiro
Update: st0012 kindly mentioned that the relevant issue https://github.com/ruby/debug/issues/797