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

ActionView::Template::Error with Docker #598

Open
wxfnyu opened this issue Feb 8, 2020 · 5 comments
Open

ActionView::Template::Error with Docker #598

wxfnyu opened this issue Feb 8, 2020 · 5 comments

Comments

@wxfnyu
Copy link

wxfnyu commented Feb 8, 2020

Expected behavior

A local version of the notebook.ai website, running in development mode would be accessible via webbrowser using http://localhost:3000

Actual behavior

image

Steps to reproduce the behavior

Follow the instructions for the docker install in the readme. (screenshotted in case readme changes at a later date)

image

I've only verified this to be an issue on Windows 10, I have not yet tested it on any other operating systems. I have confirmed this to be an issue on two different Windows 10 systems.

The version of the project being used is the 3.1.0 release.

Application trace in text form

app/views/main/index.html.erb:26:in `_app_views_main_index_html_erb__3690971147142007073_47068045561520'
@drusepth
Copy link
Member

drusepth commented Feb 8, 2020

I'm probably going to remove the Docker instructions from the README soon, since they were contributed by the community a couple years ago and haven't been updated since (and I don't use Docker, nor do I develop on Windows). My general recommendation is to set up the stack manually, which gives a lot more insight into the stack and what might be going wrong.

As for this specific error, it looks likes something's going wrong with Sprockets when referencing an asset (the image being rendered on that line). My guess is that it's probably a Windows-specific error in Sprockets' implementation. You might check if there's a newer version of Sprockets (ideally on the 3.x branch, since 4.x triggers a segfault as-is), or you could try disabling Sprockets altogether (just removing the gem should do it) and falling back on Rails native asset management.

@wxfnyu
Copy link
Author

wxfnyu commented Feb 9, 2020

Hmm, I'll see if I can see exactly what's going on in terms of the sprockets version on the dockerfile, given that the container is essentially a Linux VM I don't think that I should be running into any Windows specific issues in terms of application behavior.

Have people been updating the dockerfile consistently in PRs or is it just kind of abandoned?

@drusepth
Copy link
Member

drusepth commented Feb 9, 2020

Thanks! I'm happy to help diagnose what's going on, and if you figure it out a PR would be much appreciated!

The Dockerfile itself was committed in in 2016 and only updated a few times since then, of which most are just ruby version bumps to match the version recommended in the README.

Luckily, both the Dockerfile and the docker-compose file are super small/simple and our stack hasn't really changed much in years, so it should theoretically only need minimal changes to get back up to speed.

@joelmichael
Copy link
Contributor

This is a common problem when using Windows with Docker due to the case insensitivity of the Windows filesystem. Information on a fix is here: https://github.com/research-technologies/dart_provisioning/wiki/Vagrant-and-Rails-with-shared-folders-on-a-Windows-host

Basically a hack is necessary in which an environment variable can be set. Then some code is added to application.rb which alters the asset caching directory so it can use the /tmp directory within Docker's Linux VM instead of the tmp directory in the Rails application directory. This avoids the problem by avoiding the Windows filesystem.

@joelmichael
Copy link
Contributor

Better description of the problem and solution here: rails/sprockets#283

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

No branches or pull requests

3 participants