Comments (12)
I think we can close this @dhh
from tailwindcss-rails.
I ran into the same problem and the above didnt work for me (perhaps I didnt follow all the steps)
Specifically I get the error ERROR: tailwindcss-rails does not support the aarch64-linux platform
on M1 Mac running tailwind in an alpine docker container using the rails command bin/rails tailwindcss:watch
Digging into this gems code we can see it compares the platform with the matching executable
irb(main):001:0> Gem::Platform.match('aarch64-linux')
=> false
irb(main):002:0> Gem.platforms
=> ["ruby", #<Gem::Platform:0x0000ffff94611888 @cpu="aarch64", @os="linux", @version="musl">]
It seems that the musl
causes a mismatch - this is the alpine stdlib and there is a ticket here which purports to fix it but does not: rubygems/rubygems#5852
My fix was to bypass the rails command and run the executable directly using something like this:
/usr/local/bundle/gems/tailwindcss-rails-2.0.12-aarch64-linux/exe/aarch64-linux/tailwindcss -i /app/app/assets/stylesheets/application.tailwind.css -o /app/app/assets/builds/tailwind.css -c /app/config/tailwind.config.js --minify -w
from tailwindcss-rails.
I still can't get it working, and I'm very confused by the above. If my architecture is ARM, why do I want to force it to install x86_64 binaries?
Won't that end up running everything more slowly, under Rosetta 2 (and breaking completely when Apple discontinues that)?
from tailwindcss-rails.
Please make sure you're on the most recent version of Bundler. If you're still having problems, please open a new issue and we can dig in together.
from tailwindcss-rails.
@wdiechmann - Sorry you're having a problem, I'll try to help.
Inside your docker container, what does ruby -v
emit? What does gem env
emit?
from tailwindcss-rails.
oh no - don't be sorry - it's me being sorry not able to offer any help solving this (giving back just something to the community) - but I'll take that help any given (Monday) 🤣
root@c9d65417ca89:/app# ruby -v
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [aarch64-linux]
root@c9d65417ca89:/app# gem env
RubyGems Environment:
- RUBYGEMS VERSION: 3.2.32
- RUBY VERSION: 3.0.3 (2021-11-24 patchlevel 157) [aarch64-linux]
- INSTALLATION DIRECTORY: /usr/local/bundle
- USER INSTALLATION DIRECTORY: /root/.local/share/gem/ruby/3.0.0
- RUBY EXECUTABLE: /usr/local/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /usr/local/bundle/bin
- SPEC CACHE DIRECTORY: /root/.local/share/gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
- RUBYGEMS PLATFORMS:
- ruby
- aarch64-linux
- GEM PATHS:
- /usr/local/bundle
- /root/.local/share/gem/ruby/3.0.0
- /usr/local/lib/ruby/gems/3.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- "install" => "--no-document"
- "update" => "--no-document"
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /usr/local/bundle/bin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
root@c9d65417ca89:/app#
from tailwindcss-rails.
I guess I'm on my way to "the land of containers" -- pulling the finer print on the container underlines that tailwindcss-rails is entirely without fault (I think)
"Architecture": "arm64",
√ mindling % docker image inspect mindling_mindling
[
{
"Id": "sha256:f242988c9cb499c9800d1a63658e3b59532b9363b7c69d5e78fff54acb4ff2bb",
"RepoTags": [
"mindling_mindling:latest"
],
"RepoDigests": [],
"Parent": "sha256:f81e1251a06caef8172645d6461f5f0c352bd201538797c31831a1d3575f28d3",
"Comment": "",
"Created": "2021-12-20T21:33:33.867996384Z",
"Container": "ec400067e25d3c5fde6af04d97b78efa0c97c4fb118429e2c6a418e52b1ece43",
"ContainerConfig": {
"Hostname": "ec400067e25d",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"RUBY_MAJOR=3.0",
"RUBY_VERSION=3.0.3",
"RUBY_DOWNLOAD_SHA256=88cc7f0f021f15c4cd62b1f922e3a401697f7943551fe45b1fdf4f2417a17a9c",
"GEM_HOME=/usr/local/bundle",
"BUNDLE_SILENCE_ROOT_WARNING=1",
"BUNDLE_APP_CONFIG=/usr/local/bundle"
],
"Cmd": [
"/bin/sh",
"-c",
"#(nop) ",
"CMD [\"rails\" \"server\" \"-b\" \"0.0.0.0\"]"
],
"Image": "sha256:f81e1251a06caef8172645d6461f5f0c352bd201538797c31831a1d3575f28d3",
"Volumes": null,
"WorkingDir": "/app",
"Entrypoint": [
"entrypoint.sh"
],
"OnBuild": null,
"Labels": {}
},
"DockerVersion": "20.10.11",
"Author": "",
"Config": {
"Hostname": "",
"Domainname": "",
"User": "",
"AttachStdin": false,
"AttachStdout": false,
"AttachStderr": false,
"ExposedPorts": {
"3000/tcp": {}
},
"Tty": false,
"OpenStdin": false,
"StdinOnce": false,
"Env": [
"PATH=/usr/local/bundle/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"LANG=C.UTF-8",
"RUBY_MAJOR=3.0",
"RUBY_VERSION=3.0.3",
"RUBY_DOWNLOAD_SHA256=88cc7f0f021f15c4cd62b1f922e3a401697f7943551fe45b1fdf4f2417a17a9c",
"GEM_HOME=/usr/local/bundle",
"BUNDLE_SILENCE_ROOT_WARNING=1",
"BUNDLE_APP_CONFIG=/usr/local/bundle"
],
"Cmd": [
"rails",
"server",
"-b",
"0.0.0.0"
],
"Image": "sha256:f81e1251a06caef8172645d6461f5f0c352bd201538797c31831a1d3575f28d3",
"Volumes": null,
"WorkingDir": "/app",
"Entrypoint": [
"entrypoint.sh"
],
"OnBuild": null,
"Labels": null
},
"Architecture": "arm64",
"Variant": "v8",
"Os": "linux",
"Size": 957009464,
"VirtualSize": 957009464,
"GraphDriver": {
"Data": {
"LowerDir": "/var/lib/docker/overlay2/a4370d7bfef94f3dcf8b8db5fe226624dcf27f7ed9c7fed7ace4e40c3ab1367b/diff:/var/lib/docker/overlay2/db5b95d78a781e3fb20c98bb761e6ba4946a8fbb8fd3d8a9c2b16a5ea90dc201/diff:/var/lib/docker/overlay2/4013dfe6f62521d8b8627bc4e41f0cf6770eef74baf479ec825684fb80dae4dd/diff:/var/lib/docker/overlay2/d4d2e3f962b4a401b5a46a9e9cc76c5263291627cca00c264b46814730eaeda9/diff:/var/lib/docker/overlay2/8a5f9592b1abe839ad86f0e73e45b447e30bc6b1ce6b65721e44c3c6d7ae208e/diff:/var/lib/docker/overlay2/02977e98c260724224787cba6b86c5ace98982886d7bee3b72dc1813a8b51ad0/diff:/var/lib/docker/overlay2/dfb68af05d27880d2cd39308a453bb1016d7352b7205962230279d4ee9c50b43/diff:/var/lib/docker/overlay2/befe96c96561bff26a9102522102eec1769bc61e88363a84fbaa79b3c9ccb431/diff:/var/lib/docker/overlay2/f17555df2a4471d59d2938c0e7b738abc4f74c192fb37f600b802f3d07a05524/diff:/var/lib/docker/overlay2/038d1d0969dcb2cb9c60f44345d5bf902394ad70916cb6bd76089ad1ef2b92b3/diff:/var/lib/docker/overlay2/7f404f031fd131dde9f192e76d85956fd67c18e167941525d954cd6e70b20db5/diff:/var/lib/docker/overlay2/fbfcf813065f89ee158fa294ee3c17edd524ba035fa853d93c3a5b158368d3b6/diff:/var/lib/docker/overlay2/633e0411278e3fd81b0db049d6f4b96674de5bb0d65107d13313ede2c14d55ee/diff",
"MergedDir": "/var/lib/docker/overlay2/ff15dc7996672f3d68ae0e0eb80b47401b3cc4deb3ac29f0d83253d72de1b32c/merged",
"UpperDir": "/var/lib/docker/overlay2/ff15dc7996672f3d68ae0e0eb80b47401b3cc4deb3ac29f0d83253d72de1b32c/diff",
"WorkDir": "/var/lib/docker/overlay2/ff15dc7996672f3d68ae0e0eb80b47401b3cc4deb3ac29f0d83253d72de1b32c/work"
},
"Name": "overlay2"
},
"RootFS": {
"Type": "layers",
"Layers": [
"sha256:c83a1e9f8928c8475c4b26facacb6c90fd76afc61e6b02b0ed07084eab6cd996",
"sha256:ebb785818cd967192bc651106ed517ee4fdbf4da86f9a2ae511dff790451d68f",
"sha256:2c62d9fb0ac2cea00189bb9e3ccec5544ca0f16fd97f465abdafe7315797af02",
"sha256:621d723cc532662f594c373ae0172da6b372b24a049dc69fd9f0944a50816756",
"sha256:31f97397a8f27f75dd9e59d423c4510e6cf293d6a3013a9a25d987ed650343f0",
"sha256:c6fb555e9c0add89d68368c0fa9d1ff09ae0f79c8c98eaf7bd5038041cf291aa",
"sha256:ac2c27936d8a1190347ee837640a117832567d09e577614f323b1f37af77f280",
"sha256:270675516ae7d76b73c9a1ef050a89cc37b723b57c3c39d9d89be504150637ea",
"sha256:10966c0a6ba9ad099d56d47b3cd73c59122f9e43c0fd8ce85ff5160b1d812da0",
"sha256:74bc7e62c0cd2089b50cee7195cbaea2fb969aa397c7f5f8711bb9b8d72aff7d",
"sha256:a717f9a8a13b8417746e49e3fd8768c0421d3b358cfab7494de153aae2364625",
"sha256:1c1eba780ce65324e9a31e3240736e1ca718345baa98579e11a537b5b6ca1812",
"sha256:716d67ee2ed8d6c5236012ee51e738a897d75666514e1b820efa6ae36db338ea",
"sha256:716d67ee2ed8d6c5236012ee51e738a897d75666514e1b820efa6ae36db338ea"
]
},
"Metadata": {
"LastTagTime": "2021-12-20T21:33:34.214568176Z"
}
}
]
from tailwindcss-rails.
@wdiechmann OK, since your version of Ruby says it's aarch64-linux
that's why it's trying to not installing x86_64-linux
platform gems.
Your best bet is to follow the instructions at https://tailwindcss.com/docs/installation to install tailwindcss via npm.
from tailwindcss-rails.
well - roger that - but I'm not going down the npm gauntlet again 🤣
not with this beautiful piece of 'ware letting out sirene songs from those cliffs up high 😄
but thx a bunch for holding my hand and administering a cold handkerchief on my forehead ❤️
from tailwindcss-rails.
BTW - this docker/for-linux#1170 confirms it and now I just have to find out how to impersonate the correct platform for tailwindcss to ask for
it certainly is xmas all around 😌
from tailwindcss-rails.
I'm addressing the issue here - placing all my faith in the "Gods of Container Heaven"
from tailwindcss-rails.
For good measure:
SOLVED!
build the container "by hand" - using docker build --platform linux/x86_64
and then stick the same platform argument into the docker-compose.yml (I suspect once there is an image you don't need to build it by hand anymore - how all the finer print reads is sadly beyond me) making the [important parts of the ] docker-compose.yml look like this:
#
# Most if not all of it is a blatant c/p from
# Will Schenk's https://willschenk.com/articles/2020/rails_in_docker/
#
version: "3.9"
services:
...8<...
mindling:
platform: linux/x86_64
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- ./src:/app
ports:
- "3000:3000"
depends_on:
- db
from tailwindcss-rails.
Related Issues (20)
- Remove Inter font assets from inclusion in downstream projects HOT 6
- Support @config directive and multiple *.tailwind.css files HOT 1
- use scaffold generate password class is nil HOT 2
- `rails tailwindcss:build` causes Segmentation fault for Ruby 3.3.0 on aarch64-linux HOT 3
- tailwindcss:watch terminates with exception HOT 10
- uninitialized constant Tailwindcss (NameError) when launching puma HOT 16
- Watcher not working in Docker even with `tty:true` HOT 2
- How do I get the color palette from the tailwind docs to work? HOT 1
- Allow to choose between Procfile.dev or Puma plugin
- Classes not loaded while building
- TailwindCSS does not support react-on-rails with scss HOT 1
- Run bin/dev, but it failed to install foreman HOT 5
- Not working on x86 architecture
- Rails underscore escaping issues HOT 2
- Tailwind scaffold template is out of sync with rails/rails ERB scaffold template HOT 2
- May be time to remove @tailwindcss/aspect-ratio HOT 4
- Debugger hangs when I use the watcher as plugin! HOT 2
- bin/dev doesn't work for me. HOT 3
- Automate gem build and deployment with github actions HOT 2
- Investigate failing CI build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tailwindcss-rails.