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 assets:precompile gives error: tailwindcss-rails does not support the x86_64-linux platform #200

Closed
deflexor opened this issue Sep 12, 2022 · 10 comments · Fixed by #202

Comments

@deflexor
Copy link

Dockerfile:

FROM ruby:3.1.2-alpine
WORKDIR /app
COPY . .
RUN apk add --update --no-cache build-base gcc g++ git less tzdata \
  libstdc++ libffi-dev libc-dev sqlite-dev postgresql-dev build-base gcompat
RUN gem install bundler
RUN bundle lock --add-platform x86_64-linux
RUN bundle --verbose
ENV RAILS_ENV=production
RUN bundle exec rails assets:clean assets:precompile
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]

Results in error:

Tailwindcss::Commands::UnsupportedPlatformException: tailwindcss-rails does not support the x86_64-linux platform

@flavorjones
Copy link
Member

flavorjones commented Sep 13, 2022

Hi, sorry you're having a problem, I'll try to help.

This gem absolutely supports alpine, so we'll need more information about your Rails app to diagnose what's going on. Can you please share the output of bundle env in this container on your rails application?

@gucki
Copy link

gucki commented Sep 16, 2022

@flavorjones I just hit the same issue with a new (minimal) rails 7.0.4 application. It seems it only occurs when using rubygems 3.3.22. It does not occur when using rubygems 3.3.7 (but this version causes rubygems/rubygems#5351). In all cases using ruby:3.1-alpine as base image.

@flavorjones
Copy link
Member

@gucki I think you're describing rubygems/rubygems#5914? But I'm only guessing because I don't know what command you're running (gem or bundle) or other info about your system

@deflexor Can you please share the output of bundle env in this container on your rails application?

@deflexor
Copy link
Author

deflexor commented Sep 16, 2022

Hello, here it is.

Environment

Bundler       2.3.22
  Platforms   ruby, x86_64-linux-musl
Ruby          3.1.2p20 (2022-04-12 revision 4491bb740a9506d76391ac44bb2fe6e483fec952) [x86_64-linux-musl]
  Full Path   /usr/local/bin/ruby
  Config Dir  /usr/local/etc
RubyGems      3.3.7
  Gem Home    /usr/local/bundle
  Gem Path    /root/.local/share/gem/ruby/3.1.0:/usr/local/lib/ruby/gems/3.1.0:/usr/local/bundle
  User Home   /root
  User Path   /root/.local/share/gem/ruby/3.1.0
  Bin Dir     /usr/local/bundle/bin
Tools         
  Git         not installed
  RVM         not installed
  rbenv       not installed
  chruby      not installed

@gucki
Copy link

gucki commented Sep 16, 2022

@flavorjones No, when I have rubygems 3.3.22 installed and run bin/dev I get "Tailwindcss::Commands::UnsupportedPlatformException: tailwindcss-rails does not support the x86_64-linux platform". When I downgrade to rubygems 3.3.7 bin/dev works without any issues (I'm not reinstalling any gems manually, just up/ downgrading rubygems itself). But please note that the different rubygems versions also include a different version of bundler (2.3.7 vs 2.3.22). Actually, according to the env of @deflexor, the bundler version seems to be the issue. @deflexor Please try to use bundler 2.3.7, I suspect it works then.

@flavorjones
Copy link
Member

I see ... just to confirm, the native gem is installing fine but you're getting this error from the tailwindcss wrapper. Interesting. I'll dig in a bit more.

@flavorjones
Copy link
Member

@flavorjones
Copy link
Member

OK, I've identified the problem upstream in rubygems, and bug has been filed here: rubygems/rubygems#5938

@flavorjones
Copy link
Member

Release v2.0.14 / 2022-09-19 · rails/tailwindcss-rails has been released which works around this bug.

@gucki
Copy link

gucki commented Sep 20, 2022

@flavorjones Thank you! I can confirm it fixed the issue for me.

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

Successfully merging a pull request may close this issue.

3 participants