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

No such file or directory #115

Closed
EnziinSystem opened this issue Dec 26, 2021 · 6 comments
Closed

No such file or directory #115

EnziinSystem opened this issue Dec 26, 2021 · 6 comments

Comments

@EnziinSystem
Copy link

EnziinSystem commented Dec 26, 2021

My environment:

  • Ruby: 3.0.3
  • Rails: 7.0.0
  • Linux Alpine 3.15

Add tailwindcss to the app:

./bin/rails tailwindcss:install

The error message:

Add Tailwindcss include tags and container element in application layout
      insert  app/views/layouts/application.html.erb
      insert  app/views/layouts/application.html.erb
      insert  app/views/layouts/application.html.erb
Build into app/assets/builds
      create  app/assets/builds
      create  app/assets/builds/.keep
      append  app/assets/config/manifest.js
      append  .gitignore
Add default config/tailwindcss.config.js
      create  config/tailwind.config.js
Add default app/assets/stylesheets/application.tailwind.css
      create  app/assets/stylesheets/application.tailwind.css
Add default Procfile.dev
      create  Procfile.dev
Ensure foreman is installed
         run  gem install foreman from "."
Successfully installed foreman-0.87.2
1 gem installed
Add bin/dev to start foreman
      create  bin/dev
Compile initial Tailwind build
         run  rails tailwindcss:build from "."
+ /usr/local/bundle/gems/tailwindcss-rails-2.0.2-x86_64-linux/exe/x86_64-linux/tailwindcss -i /home/blog/app/assets/stylesheets/application.tailwind.css -o /home/blog/app/assets/builds/tailwind.css -c /home/blog/config/tailwind.config.js
/usr/local/bundle/gems/tailwindcss-rails-2.0.2-x86_64-linux/lib/tasks/../../exe/tailwindcss:40:in `exec': No such file or directory - /usr/local/bundle/gems/tailwindcss-rails-2.0.2-x86_64-linux/exe/x86_64-linux/tailwindcss (Errno::ENOENT)
	from /usr/local/bundle/gems/tailwindcss-rails-2.0.2-x86_64-linux/lib/tasks/../../exe/tailwindcss:40:in `<main>'

However, if I list the directory then it still exists.

$ ls /usr/local/bundle/gems/tailwindcss-rails-2.0.2-x86_64-linux/exe/x86_64-linux
tailwindcss
@alex-damian-negru
Copy link

alex-damian-negru commented Dec 26, 2021

I've got this same issue but in a dockerized container (alpine linux as well). Weirdly enough the file does exist in the container but the error mentions it doesn't. 😕

@alex-damian-negru
Copy link

After digging a bit more, I may have found the issue.

Running ldd yielded the following:

bash-5.1# ldd tailwindcss 
        /lib64/ld-linux-x86-64.so.2 (0x7f0a74fb8000)
        libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f0a74fb8000)
        libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f0a74e17000)
        libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f0a74fb8000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f0a74dfd000)
        libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f0a74fb8000)
        libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f0a74fb8000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by tailwindcss)

Alpine linux seems to be missing some interpreter. Basically that's the missing file, not the tailwindcss one.

This led me to gliderlabs/docker-alpine#219 and then to https://wiki.alpinelinux.org/wiki/Running_glibc_programs. I then added gcompat to my dockerfile and tailwind could then run successfully.


Tl;Dr Try installing gcompat in your alpine environment.

@EnziinSystem
Copy link
Author

I install the gcompat package:

apk add gcompat

And

/home/blog # ldd tailwindcss
/lib/ld-musl-x86_64.so.1: cannot load tailwindcss: No such file or directory

However the file "/lib/ld-musl-x86_64.so.1" still exists.

/home/blog # ls /lib
apk                     libc.musl-x86_64.so.1   libfdisk.so.1.1.0       libpam_misc.so.0        librt.so.1              libuuid.so.1            pkgconfig
firmware                libc.so.6               libgcompat.so.0         libpam_misc.so.0.82.1   libsmartcols.so.1       libuuid.so.1.3.0        rc
ld-linux-x86-64.so.2    libcom_err.so.2         libm.so.6               libpamc.so.0            libsmartcols.so.1.1.0   libz.so                 security
ld-musl-x86_64.so.1     libcom_err.so.2.1       libmount.so.1           libpamc.so.0.82.1       libssl.so.1.1           libz.so.1               sysctl.d
libapk.so.3.12.0        libcrypt.so.1           libmount.so.1.1.0       libprocps.so.8          libucontext.so.1        libz.so.1.2.11
libblkid.so.1           libcrypto.so.1.1        libpam.so.0             libprocps.so.8.0.3      libucontext_posix.so.1  mdev
libblkid.so.1.1.0       libfdisk.so.1           libpam.so.0.85.1        libpthread.so.0         libutil.so.1            modules-load.d

@flavorjones
Copy link
Member

Unfortunately there's not much we can do within this gem to address how the upstream binaries are being built; we are simply repackaging the executables from https://github.com/tailwindlabs/tailwindcss

See related discussion upstream at:

@dhh I think we should close this. I'll submit a PR to the README to clarify the workaround of gcompat.

@flavorjones
Copy link
Member

@EnziinSystem try also installing build-base:

apk add build-base gcompat 

@flavorjones
Copy link
Member

See #123

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

4 participants