Skip to content

Support for arm64-darwin-21 #117

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

Conversation

juanmanuelramallo
Copy link

Steps to reproduce

  1. Make sure to run these commands on a M1 Pro machine
  2. Run ./bin/bundle add tailwindcss-rails
  3. Run ./bin/rails tailwindcss:install

Expected

Tailwind is correctly installed in the app

Actual

The following error is displayed:

ERROR: Cannot find the tailwindcss executable for arm64-darwin-21 in ~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe
If you're using bundler, please make sure you're on the latest bundler version:

  gem install bundler
  bundle update --bundler

Then make sure your lock file includes this platform by running:

  bundle lock --add-platform arm64-darwin-21
  bundle install

See `bundle lock --help` output for details.

Description

Apple's M1 Pro chip is referenced as arm64-darwin-21. So the
installation process can't succeed because the executable file is
missing for the platform.

In order to test this, I did the following:

  1. Cloned the repo,
  2. Updated the NATIVE_PLATOFORMS constant
  3. Ran rake gem:arm64-darwin-21
  4. Copied the newly generated folder from the gem's repo ./exe/arm64-darwin-21 to the gem's folder in my machine ~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe/arm64-darwin-21
  5. Ran the ./bin/rails tailwindcss:install command and everything worked successfully
  6. Tailwind was properly installed

Perhaps we could update the package.rake to alias arm64-darwin to arm64-darwin-21 or something similar. Perhaps this will make more sense if it becomes a trend for Apple to change their processor's arch name after a new release. I'm still unsure if the M1 Max has a different name, I'd bet it does.

Apple's M1 Pro chip is referenced as arm64-darwin-21. So the
installation process can't succeed because the executable file is
missing for the platform.
@dhh
Copy link
Member

dhh commented Dec 28, 2021

Cc @flavorjones

@dinshaw-he
Copy link

I also ran into this with Rails 7 rails new demo --css tailwind. After following all the arm-specific prompts I tried to run ./bin/dev and got:

./bin/dev 
08:31:06 web.1  | started with pid 81012
08:31:06 css.1  | started with pid 81013
08:31:07 web.1  | => Booting Puma
08:31:07 web.1  | => Rails 7.0.0 application starting in development 
08:31:07 web.1  | => Run `bin/rails server --help` for more startup options
08:31:07 web.1  | Puma starting in single mode...
08:31:07 web.1  | * Puma version: 5.5.2 (ruby 3.0.3-p157) ("Zawgyi")
08:31:07 web.1  | *  Min threads: 5
08:31:07 web.1  | *  Max threads: 5
08:31:07 web.1  | *  Environment: development
08:31:07 web.1  | *          PID: 81012
08:31:07 web.1  | * Listening on http://127.0.0.1:3000
08:31:07 web.1  | * Listening on http://[::1]:3000
08:31:07 web.1  | Use Ctrl-C to stop
08:31:07 css.1  | ERROR: Cannot find the tailwindcss executable for arm64-darwin-21 in /Users/dinshawgobhai/.frum/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.2/exe
08:31:07 css.1  | If you're using bundler, please make sure you're on the latest bundler version:
08:31:07 css.1  | 
08:31:07 css.1  |   gem install bundler
08:31:07 css.1  |   bundle update --bundler
08:31:07 css.1  | 
08:31:07 css.1  | Then make sure your lock file includes this platform by running:
08:31:07 css.1  | 
08:31:07 css.1  |   bundle lock --add-platform arm64-darwin-21
08:31:07 css.1  |   bundle install
08:31:07 css.1  | 
08:31:07 css.1  | See `bundle lock --help` output for details.
08:31:07 css.1  | exited with code 0
08:31:07 system | sending SIGTERM to all processes
08:31:07 web.1  | - Gracefully stopping, waiting for requests to finish
08:31:07 web.1  | Exiting
08:31:07 web.1  | terminated by SIGTERM

@flavorjones
Copy link
Member

@juanmanuelramallo and @dinshaw-he - did you follow the instructions in the error message and make sure you had added the native platform to your lock file? If so, please respond with:

  • the output from gem env
  • the output from bundle show
  • the contents of your Gemfile.lock

Without more information, my guess is that you've installed the "vanilla" ruby platform gem and not the native platform gem. The above information will help me diagnose more specifically.

@juanmanuelramallo
Copy link
Author

juanmanuelramallo commented Jan 3, 2022

Yes, I added the native platform to my lockfile as specified in the error message.

gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.32
  - RUBY VERSION: 3.0.3 (2021-11-24 patchlevel 157) [arm64-darwin21]
  - INSTALLATION DIRECTORY: ~/.gem/ruby/3.0.3
  - USER INSTALLATION DIRECTORY: ~/.gem/ruby/3.0.0
  - RUBY EXECUTABLE: ~/.rubies/ruby-3.0.3/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: ~/.gem/ruby/3.0.3/bin
  - SPEC CACHE DIRECTORY: ~/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: ~/.rubies/ruby-3.0.3/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-21
  - GEM PATHS:
     - ~/.gem/ruby/3.0.3
     - ~/.rubies/ruby-3.0.3/lib/ruby/gems/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - ~/.gem/ruby/3.0.3/bin
     - ~/.rubies/ruby-3.0.3/lib/ruby/gems/3.0.0/bin
     - ~/.rubies/ruby-3.0.3/bin
     - ~/.nvm/versions/node/v12.22.5/bin
     - /opt/homebrew/bin
     - /opt/homebrew/sbin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /Applications/Postgres.app/Contents/Versions/latest/bin
bundle show
Gems included by the bundle:
  * actioncable (7.0.0)
  * actionmailbox (7.0.0)
  * actionmailer (7.0.0)
  * actionpack (7.0.0)
  * actiontext (7.0.0)
  * actionview (7.0.0)
  * activejob (7.0.0)
  * activemodel (7.0.0)
  * activerecord (7.0.0)
  * activestorage (7.0.0)
  * activesupport (7.0.0)
  * addressable (2.8.0)
  * annotate (2.6.5)
  * ast (2.4.2)
  * aws-eventstream (1.2.0)
  * aws-partitions (1.543.0)
  * aws-sdk-core (3.125.0)
  * aws-sdk-kms (1.53.0)
  * aws-sdk-s3 (1.110.0)
  * aws-sigv4 (1.4.0)
  * bcrypt (3.1.16)
  * bindex (0.8.1)
  * bootsnap (1.9.3)
  * builder (3.2.4)
  * bundler (2.3.3)
  * capybara (3.36.0)
  * capybara-screenshot (1.0.25)
  * childprocess (4.1.0)
  * concurrent-ruby (1.1.9)
  * connection_pool (2.2.5)
  * crack (0.4.5)
  * crass (1.0.6)
  * debug (1.4.0)
  * devise (4.8.1)
  * diff-lcs (1.5.0)
  * docile (1.4.0)
  * dotenv (2.7.6)
  * dotenv-rails (2.7.6)
  * erubi (1.10.0)
  * factory_bot (6.2.0)
  * factory_bot_rails (6.2.0)
  * faker (2.19.0)
  * globalid (1.0.0)
  * hashdiff (1.0.1)
  * i18n (1.8.11)
  * importmap-rails (1.0.1)
  * inline_svg (1.7.2)
  * io-console (0.5.9)
  * irb (1.4.1)
  * jbuilder (2.11.5)
  * jmespath (1.4.0)
  * json (2.6.1)
  * launchy (2.5.0)
  * letter_opener (1.7.0)
  * loofah (2.13.0)
  * madmin (1.2.6)
  * mail (2.7.1)
  * marcel (1.0.2)
  * matrix (0.4.2)
  * method_source (1.0.0)
  * mini_mime (1.1.2)
  * mini_portile2 (2.6.1)
  * minitest (5.15.0)
  * msgpack (1.4.2)
  * nio4r (2.5.8)
  * nokogiri (1.12.5)
  * orm_adapter (0.5.0)
  * pagy (5.6.6)
  * parallel (1.21.0)
  * parser (3.0.3.2)
  * pg (1.2.3)
  * public_suffix (4.0.6)
  * puma (5.5.2)
  * pundit (2.1.1)
  * racc (1.6.0)
  * rack (2.2.3)
  * rack-test (1.1.0)
  * rails (7.0.0)
  * rails-dom-testing (2.0.3)
  * rails-html-sanitizer (1.4.2)
  * railties (7.0.0)
  * rainbow (3.0.0)
  * rake (13.0.6)
  * redis (4.5.1)
  * regexp_parser (2.2.0)
  * reline (0.3.0)
  * responders (3.0.1)
  * rexml (3.2.5)
  * rspec-core (3.10.1)
  * rspec-expectations (3.10.1)
  * rspec-log_matcher (1.1.0)
  * rspec-mocks (3.10.2)
  * rspec-rails (5.0.2)
  * rspec-retry (0.6.2)
  * rspec-support (3.10.3)
  * rubocop (1.23.0)
  * rubocop-ast (1.15.1)
  * rubocop-performance (1.12.0)
  * ruby-progressbar (1.11.0)
  * rubyzip (2.3.2)
  * selenium-webdriver (4.1.0)
  * shoulda-matchers (5.1.0)
  * sidekiq (6.3.1)
  * simple_form (5.1.0)
  * simplecov (0.17.1)
  * simplecov-html (0.10.2)
  * sprockets (4.0.2)
  * sprockets-rails (3.4.2)
  * standard (1.5.0)
  * stimulus-rails (1.0.2)
  * tailwindcss-rails (2.0.2)
  * thor (1.1.0)
  * turbo-rails (1.0.0)
  * tzinfo (2.0.4)
  * unicode-display_width (2.1.0)
  * warden (1.2.9)
  * web-console (4.2.0)
  * webdrivers (5.0.0)
  * webmock (3.14.0)
  * websocket-driver (0.7.5)
  * websocket-extensions (0.1.5)
  * xpath (3.2.0)
  * zeitwerk (2.5.2)
cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    actioncable (7.0.0)
      actionpack (= 7.0.0)
      activesupport (= 7.0.0)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (7.0.0)
      actionpack (= 7.0.0)
      activejob (= 7.0.0)
      activerecord (= 7.0.0)
      activestorage (= 7.0.0)
      activesupport (= 7.0.0)
      mail (>= 2.7.1)
    actionmailer (7.0.0)
      actionpack (= 7.0.0)
      actionview (= 7.0.0)
      activejob (= 7.0.0)
      activesupport (= 7.0.0)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (7.0.0)
      actionview (= 7.0.0)
      activesupport (= 7.0.0)
      rack (~> 2.0, >= 2.2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (7.0.0)
      actionpack (= 7.0.0)
      activerecord (= 7.0.0)
      activestorage (= 7.0.0)
      activesupport (= 7.0.0)
      globalid (>= 0.6.0)
      nokogiri (>= 1.8.5)
    actionview (7.0.0)
      activesupport (= 7.0.0)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (7.0.0)
      activesupport (= 7.0.0)
      globalid (>= 0.3.6)
    activemodel (7.0.0)
      activesupport (= 7.0.0)
    activerecord (7.0.0)
      activemodel (= 7.0.0)
      activesupport (= 7.0.0)
    activestorage (7.0.0)
      actionpack (= 7.0.0)
      activejob (= 7.0.0)
      activerecord (= 7.0.0)
      activesupport (= 7.0.0)
      marcel (~> 1.0)
      mini_mime (>= 1.1.0)
    activesupport (7.0.0)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
    addressable (2.8.0)
      public_suffix (>= 2.0.2, < 5.0)
    annotate (2.6.5)
      activerecord (>= 2.3.0)
      rake (>= 0.8.7)
    ast (2.4.2)
    aws-eventstream (1.2.0)
    aws-partitions (1.543.0)
    aws-sdk-core (3.125.0)
      aws-eventstream (~> 1, >= 1.0.2)
      aws-partitions (~> 1, >= 1.525.0)
      aws-sigv4 (~> 1.1)
      jmespath (~> 1.0)
    aws-sdk-kms (1.53.0)
      aws-sdk-core (~> 3, >= 3.125.0)
      aws-sigv4 (~> 1.1)
    aws-sdk-s3 (1.110.0)
      aws-sdk-core (~> 3, >= 3.125.0)
      aws-sdk-kms (~> 1)
      aws-sigv4 (~> 1.4)
    aws-sigv4 (1.4.0)
      aws-eventstream (~> 1, >= 1.0.2)
    bcrypt (3.1.16)
    bindex (0.8.1)
    bootsnap (1.9.3)
      msgpack (~> 1.0)
    builder (3.2.4)
    capybara (3.36.0)
      addressable
      matrix
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (>= 1.5, < 3.0)
      xpath (~> 3.2)
    capybara-screenshot (1.0.25)
      capybara (>= 1.0, < 4)
      launchy
    childprocess (4.1.0)
    concurrent-ruby (1.1.9)
    connection_pool (2.2.5)
    crack (0.4.5)
      rexml
    crass (1.0.6)
    debug (1.4.0)
      irb (>= 1.3.6)
      reline (>= 0.2.7)
    devise (4.8.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0)
      responders
      warden (~> 1.2.3)
    diff-lcs (1.5.0)
    docile (1.4.0)
    dotenv (2.7.6)
    dotenv-rails (2.7.6)
      dotenv (= 2.7.6)
      railties (>= 3.2)
    erubi (1.10.0)
    factory_bot (6.2.0)
      activesupport (>= 5.0.0)
    factory_bot_rails (6.2.0)
      factory_bot (~> 6.2.0)
      railties (>= 5.0.0)
    faker (2.19.0)
      i18n (>= 1.6, < 2)
    globalid (1.0.0)
      activesupport (>= 5.0)
    hashdiff (1.0.1)
    i18n (1.8.11)
      concurrent-ruby (~> 1.0)
    importmap-rails (1.0.1)
      actionpack (>= 6.0.0)
      railties (>= 6.0.0)
    inline_svg (1.7.2)
      activesupport (>= 3.0)
      nokogiri (>= 1.6)
    io-console (0.5.9)
    irb (1.4.1)
      reline (>= 0.3.0)
    jbuilder (2.11.5)
      actionview (>= 5.0.0)
      activesupport (>= 5.0.0)
    jmespath (1.4.0)
    json (2.6.1)
    launchy (2.5.0)
      addressable (~> 2.7)
    letter_opener (1.7.0)
      launchy (~> 2.2)
    loofah (2.13.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    madmin (1.2.6)
      pagy (>= 3.5, < 6.0)
      rails (>= 6.0.3)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (1.0.2)
    matrix (0.4.2)
    method_source (1.0.0)
    mini_mime (1.1.2)
    mini_portile2 (2.6.1)
    minitest (5.15.0)
    msgpack (1.4.2)
    nio4r (2.5.8)
    nokogiri (1.12.5)
      mini_portile2 (~> 2.6.1)
      racc (~> 1.4)
    nokogiri (1.12.5-arm64-darwin)
      racc (~> 1.4)
    nokogiri (1.12.5-x86_64-linux)
      racc (~> 1.4)
    orm_adapter (0.5.0)
    pagy (5.6.6)
    parallel (1.21.0)
    parser (3.0.3.2)
      ast (~> 2.4.1)
    pg (1.2.3)
    public_suffix (4.0.6)
    puma (5.5.2)
      nio4r (~> 2.0)
    pundit (2.1.1)
      activesupport (>= 3.0.0)
    racc (1.6.0)
    rack (2.2.3)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (7.0.0)
      actioncable (= 7.0.0)
      actionmailbox (= 7.0.0)
      actionmailer (= 7.0.0)
      actionpack (= 7.0.0)
      actiontext (= 7.0.0)
      actionview (= 7.0.0)
      activejob (= 7.0.0)
      activemodel (= 7.0.0)
      activerecord (= 7.0.0)
      activestorage (= 7.0.0)
      activesupport (= 7.0.0)
      bundler (>= 1.15.0)
      railties (= 7.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.4.2)
      loofah (~> 2.3)
    railties (7.0.0)
      actionpack (= 7.0.0)
      activesupport (= 7.0.0)
      method_source
      rake (>= 12.2)
      thor (~> 1.0)
      zeitwerk (~> 2.5)
    rainbow (3.0.0)
    rake (13.0.6)
    redis (4.5.1)
    regexp_parser (2.2.0)
    reline (0.3.0)
      io-console (~> 0.5)
    responders (3.0.1)
      actionpack (>= 5.0)
      railties (>= 5.0)
    rexml (3.2.5)
    rspec-core (3.10.1)
      rspec-support (~> 3.10.0)
    rspec-expectations (3.10.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-log_matcher (1.1.0)
      rspec-core (>= 3, < 4)
    rspec-mocks (3.10.2)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.10.0)
    rspec-rails (5.0.2)
      actionpack (>= 5.2)
      activesupport (>= 5.2)
      railties (>= 5.2)
      rspec-core (~> 3.10)
      rspec-expectations (~> 3.10)
      rspec-mocks (~> 3.10)
      rspec-support (~> 3.10)
    rspec-retry (0.6.2)
      rspec-core (> 3.3)
    rspec-support (3.10.3)
    rubocop (1.23.0)
      parallel (~> 1.10)
      parser (>= 3.0.0.0)
      rainbow (>= 2.2.2, < 4.0)
      regexp_parser (>= 1.8, < 3.0)
      rexml
      rubocop-ast (>= 1.12.0, < 2.0)
      ruby-progressbar (~> 1.7)
      unicode-display_width (>= 1.4.0, < 3.0)
    rubocop-ast (1.15.1)
      parser (>= 3.0.1.1)
    rubocop-performance (1.12.0)
      rubocop (>= 1.7.0, < 2.0)
      rubocop-ast (>= 0.4.0)
    ruby-progressbar (1.11.0)
    rubyzip (2.3.2)
    selenium-webdriver (4.1.0)
      childprocess (>= 0.5, < 5.0)
      rexml (~> 3.2, >= 3.2.5)
      rubyzip (>= 1.2.2)
    shoulda-matchers (5.1.0)
      activesupport (>= 5.2.0)
    sidekiq (6.3.1)
      connection_pool (>= 2.2.2)
      rack (~> 2.0)
      redis (>= 4.2.0)
    simple_form (5.1.0)
      actionpack (>= 5.2)
      activemodel (>= 5.2)
    simplecov (0.17.1)
      docile (~> 1.1)
      json (>= 1.8, < 3)
      simplecov-html (~> 0.10.0)
    simplecov-html (0.10.2)
    sprockets (4.0.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.4.2)
      actionpack (>= 5.2)
      activesupport (>= 5.2)
      sprockets (>= 3.0.0)
    standard (1.5.0)
      rubocop (= 1.23.0)
      rubocop-performance (= 1.12.0)
    stimulus-rails (1.0.2)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.2)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.2-arm64-darwin)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.2-x86_64-linux)
      railties (>= 6.0.0)
    thor (1.1.0)
    turbo-rails (1.0.0)
      actionpack (>= 6.0.0)
      railties (>= 6.0.0)
    tzinfo (2.0.4)
      concurrent-ruby (~> 1.0)
    unicode-display_width (2.1.0)
    warden (1.2.9)
      rack (>= 2.0.9)
    web-console (4.2.0)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webdrivers (5.0.0)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (~> 4.0)
    webmock (3.14.0)
      addressable (>= 2.8.0)
      crack (>= 0.3.2)
      hashdiff (>= 0.4.0, < 2.0.0)
    websocket-driver (0.7.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.5.2)

PLATFORMS
  arm64-darwin-21
  ruby
  x86_64-linux

DEPENDENCIES
  annotate
  aws-sdk-s3
  bootsnap
  capybara
  capybara-screenshot
  debug
  devise
  dotenv-rails
  factory_bot_rails
  faker
  importmap-rails
  inline_svg
  jbuilder
  letter_opener
  madmin
  pagy
  pg (~> 1.1)
  puma (~> 5.0)
  pundit
  rails (~> 7.0.0)
  redis (~> 4.0)
  rspec-log_matcher
  rspec-rails
  rspec-retry
  shoulda-matchers
  sidekiq
  simple_form
  simplecov (~> 0.17.1)
  sprockets-rails
  standard
  stimulus-rails
  tailwindcss-rails
  turbo-rails
  tzinfo-data
  web-console
  webdrivers
  webmock

RUBY VERSION
   ruby 3.0.3p157

BUNDLED WITH
   2.3.3

@flavorjones
Copy link
Member

@juanmanuelramallo Thanks for the quick response. Can you tell me what's in the directory ~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe that's mentioned in the error message? I'd like to see the full directory hierarchy (e.g., use find or tree).

@juanmanuelramallo
Copy link
Author

find ~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe

~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe
~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe/tailwindcss

@juanmanuelramallo
Copy link
Author

This is why I executed these steps in order to make it work (from the PR's description):

  1. Ran rake gem:arm64-darwin-21
  2. Copied the newly generated folder from the gem's repo ./exe/arm64-darwin-21 to the gem's folder in my machine ~/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.2/exe/arm64-darwin-21
  3. Ran the ./bin/rails tailwindcss:install command and everything worked successfully

@flavorjones
Copy link
Member

@juanmanuelramallo Thanks again. It looks like bundler choosing to use the vanilla "ruby" platform gem, and not the native one. What version of bundler are you using? This may be a bug in bundler itself that we can report upstream (that is, bundler should prefer the native gem to the "ruby" gem if both are available).

@flavorjones
Copy link
Member

Put more specifically: I'm running bundler v2.2.32 on an M1 with both "ruby" and "arm64-darwin-21" in my lock file. When I run "bundle show --paths" I see:

/Users/flavorjones/.gem/ruby/3.0.3/gems/tailwindcss-rails-2.0.3-arm64-darwin

which is the native gem (and not the "ruby" platform gem).

@juanmanuelramallo
Copy link
Author

Ok, I'll make sure to file the issue in bundler later today, I'll do some research first.

Thank you so much for your help @flavorjones. I'll close the PR for now.

@dinshaw-he
Copy link

dinshaw-he commented Jan 3, 2022

I see this is closed and I think my situation is the same but figured I'd add this info in case it's helpful.

gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.2.32
  - RUBY VERSION: 3.0.3 (2021-11-24 patchlevel 157) [arm64-darwin21]
  - INSTALLATION DIRECTORY: ~/.frum/versions/3.0.3/lib/ruby/gems/3.0.0
  - USER INSTALLATION DIRECTORY: ~/.gem/ruby/3.0.0
  - RUBY EXECUTABLE: ~/.frum/versions/3.0.3/bin/ruby
  - GIT EXECUTABLE: /opt/homebrew/bin/git
  - EXECUTABLE DIRECTORY: ~/.frum/versions/3.0.3/bin
  - SPEC CACHE DIRECTORY: ~/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: ~/.frum/versions/3.0.3/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - arm64-darwin-21
  - GEM PATHS:
     - ~/.frum/versions/3.0.3/lib/ruby/gems/3.0.0
     - ~/.gem/ruby/3.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-document"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Applications/Postgres.app/Contents/Versions/latest/bin
     - /Applications/Sublime Text.app/Contents/SharedSupport/bin
     - .git/safe/../../bin
     - ~/.cargo/bin
     - ~/.n/bin
     - /var/folders/36/hv7j2cg95ks_lkzrts40wlsm0000gp/T/frum_10428_1641232132790/bin
     - /opt/homebrew/opt/openssl/bin
     - /opt/homebrew/bin
     - /usr/local/bin
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /opt/homebrew/share/npm/bin
bundle show
Gems included by the bundle:
  * actioncable (7.0.0)
  * actionmailbox (7.0.0)
  * actionmailer (7.0.0)
  * actionpack (7.0.0)
  * actiontext (7.0.0)
  * actionview (7.0.0)
  * activejob (7.0.0)
  * activemodel (7.0.0)
  * activerecord (7.0.0)
  * activestorage (7.0.0)
  * activesupport (7.0.0)
  * addressable (2.8.0)
  * bindex (0.8.1)
  * bootsnap (1.9.3)
  * builder (3.2.4)
  * bundler (2.3.4)
  * capybara (3.36.0)
  * childprocess (4.1.0)
  * concurrent-ruby (1.1.9)
  * crass (1.0.6)
  * debug (1.4.0)
  * erubi (1.10.0)
  * globalid (1.0.0)
  * i18n (1.8.11)
  * importmap-rails (1.0.1)
  * io-console (0.5.11)
  * irb (1.4.1)
  * jbuilder (2.11.5)
  * loofah (2.13.0)
  * mail (2.7.1)
  * marcel (1.0.2)
  * matrix (0.4.2)
  * method_source (1.0.0)
  * mini_mime (1.1.2)
  * mini_portile2 (2.6.1)
  * minitest (5.15.0)
  * msgpack (1.4.2)
  * nio4r (2.5.8)
  * nokogiri (1.12.5)
  * pg (1.2.3)
  * public_suffix (4.0.6)
  * puma (5.5.2)
  * racc (1.6.0)
  * rack (2.2.3)
  * rack-test (1.1.0)
  * rails (7.0.0)
  * rails-dom-testing (2.0.3)
  * rails-html-sanitizer (1.4.2)
  * railties (7.0.0)
  * rake (13.0.6)
  * redis (4.5.1)
  * regexp_parser (2.2.0)
  * reline (0.3.1)
  * rexml (3.2.5)
  * rubyzip (2.3.2)
  * selenium-webdriver (4.1.0)
  * sprockets (4.0.2)
  * sprockets-rails (3.4.2)
  * stimulus-rails (1.0.2)
  * tailwindcss-rails (2.0.2)
  * thor (1.1.0)
  * turbo-rails (1.0.0)
  * tzinfo (2.0.4)
  * web-console (4.2.0)
  * webdrivers (5.0.0)
  * websocket-driver (0.7.5)
  * websocket-extensions (0.1.5)
  * xpath (3.2.0)
  * zeitwerk (2.5.3)
cat Gemfile.lock
GEM
  remote: https://rubygems.org/
  specs:
    actioncable (7.0.0)
      actionpack (= 7.0.0)
      activesupport (= 7.0.0)
      nio4r (~> 2.0)
      websocket-driver (>= 0.6.1)
    actionmailbox (7.0.0)
      actionpack (= 7.0.0)
      activejob (= 7.0.0)
      activerecord (= 7.0.0)
      activestorage (= 7.0.0)
      activesupport (= 7.0.0)
      mail (>= 2.7.1)
    actionmailer (7.0.0)
      actionpack (= 7.0.0)
      actionview (= 7.0.0)
      activejob (= 7.0.0)
      activesupport (= 7.0.0)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 2.0)
    actionpack (7.0.0)
      actionview (= 7.0.0)
      activesupport (= 7.0.0)
      rack (~> 2.0, >= 2.2.0)
      rack-test (>= 0.6.3)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.0, >= 1.2.0)
    actiontext (7.0.0)
      actionpack (= 7.0.0)
      activerecord (= 7.0.0)
      activestorage (= 7.0.0)
      activesupport (= 7.0.0)
      globalid (>= 0.6.0)
      nokogiri (>= 1.8.5)
    actionview (7.0.0)
      activesupport (= 7.0.0)
      builder (~> 3.1)
      erubi (~> 1.4)
      rails-dom-testing (~> 2.0)
      rails-html-sanitizer (~> 1.1, >= 1.2.0)
    activejob (7.0.0)
      activesupport (= 7.0.0)
      globalid (>= 0.3.6)
    activemodel (7.0.0)
      activesupport (= 7.0.0)
    activerecord (7.0.0)
      activemodel (= 7.0.0)
      activesupport (= 7.0.0)
    activestorage (7.0.0)
      actionpack (= 7.0.0)
      activejob (= 7.0.0)
      activerecord (= 7.0.0)
      activesupport (= 7.0.0)
      marcel (~> 1.0)
      mini_mime (>= 1.1.0)
    activesupport (7.0.0)
      concurrent-ruby (~> 1.0, >= 1.0.2)
      i18n (>= 1.6, < 2)
      minitest (>= 5.1)
      tzinfo (~> 2.0)
    addressable (2.8.0)
      public_suffix (>= 2.0.2, < 5.0)
    bindex (0.8.1)
    bootsnap (1.9.3)
      msgpack (~> 1.0)
    builder (3.2.4)
    capybara (3.36.0)
      addressable
      matrix
      mini_mime (>= 0.1.3)
      nokogiri (~> 1.8)
      rack (>= 1.6.0)
      rack-test (>= 0.6.3)
      regexp_parser (>= 1.5, < 3.0)
      xpath (~> 3.2)
    childprocess (4.1.0)
    concurrent-ruby (1.1.9)
    crass (1.0.6)
    debug (1.4.0)
      irb (>= 1.3.6)
      reline (>= 0.2.7)
    erubi (1.10.0)
    globalid (1.0.0)
      activesupport (>= 5.0)
    i18n (1.8.11)
      concurrent-ruby (~> 1.0)
    importmap-rails (1.0.1)
      actionpack (>= 6.0.0)
      railties (>= 6.0.0)
    io-console (0.5.11)
    irb (1.4.1)
      reline (>= 0.3.0)
    jbuilder (2.11.5)
      actionview (>= 5.0.0)
      activesupport (>= 5.0.0)
    loofah (2.13.0)
      crass (~> 1.0.2)
      nokogiri (>= 1.5.9)
    mail (2.7.1)
      mini_mime (>= 0.1.1)
    marcel (1.0.2)
    matrix (0.4.2)
    method_source (1.0.0)
    mini_mime (1.1.2)
    mini_portile2 (2.6.1)
    minitest (5.15.0)
    msgpack (1.4.2)
    nio4r (2.5.8)
    nokogiri (1.12.5)
      mini_portile2 (~> 2.6.1)
      racc (~> 1.4)
    nokogiri (1.12.5-arm64-darwin)
      racc (~> 1.4)
    pg (1.2.3)
    public_suffix (4.0.6)
    puma (5.5.2)
      nio4r (~> 2.0)
    racc (1.6.0)
    rack (2.2.3)
    rack-test (1.1.0)
      rack (>= 1.0, < 3)
    rails (7.0.0)
      actioncable (= 7.0.0)
      actionmailbox (= 7.0.0)
      actionmailer (= 7.0.0)
      actionpack (= 7.0.0)
      actiontext (= 7.0.0)
      actionview (= 7.0.0)
      activejob (= 7.0.0)
      activemodel (= 7.0.0)
      activerecord (= 7.0.0)
      activestorage (= 7.0.0)
      activesupport (= 7.0.0)
      bundler (>= 1.15.0)
      railties (= 7.0.0)
    rails-dom-testing (2.0.3)
      activesupport (>= 4.2.0)
      nokogiri (>= 1.6)
    rails-html-sanitizer (1.4.2)
      loofah (~> 2.3)
    railties (7.0.0)
      actionpack (= 7.0.0)
      activesupport (= 7.0.0)
      method_source
      rake (>= 12.2)
      thor (~> 1.0)
      zeitwerk (~> 2.5)
    rake (13.0.6)
    redis (4.5.1)
    regexp_parser (2.2.0)
    reline (0.3.1)
      io-console (~> 0.5)
    rexml (3.2.5)
    rubyzip (2.3.2)
    selenium-webdriver (4.1.0)
      childprocess (>= 0.5, < 5.0)
      rexml (~> 3.2, >= 3.2.5)
      rubyzip (>= 1.2.2)
    sprockets (4.0.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.4.2)
      actionpack (>= 5.2)
      activesupport (>= 5.2)
      sprockets (>= 3.0.0)
    stimulus-rails (1.0.2)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.2)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.2-arm64-darwin)
      railties (>= 6.0.0)
    thor (1.1.0)
    turbo-rails (1.0.0)
      actionpack (>= 6.0.0)
      railties (>= 6.0.0)
    tzinfo (2.0.4)
      concurrent-ruby (~> 1.0)
    web-console (4.2.0)
      actionview (>= 6.0.0)
      activemodel (>= 6.0.0)
      bindex (>= 0.4.0)
      railties (>= 6.0.0)
    webdrivers (5.0.0)
      nokogiri (~> 1.6)
      rubyzip (>= 1.3.0)
      selenium-webdriver (~> 4.0)
    websocket-driver (0.7.5)
      websocket-extensions (>= 0.1.0)
    websocket-extensions (0.1.5)
    xpath (3.2.0)
      nokogiri (~> 1.8)
    zeitwerk (2.5.3)

PLATFORMS
  arm64-darwin-21
  ruby

DEPENDENCIES
  bootsnap
  capybara
  debug
  importmap-rails
  jbuilder
  pg (~> 1.1)
  puma (~> 5.0)
  rails (~> 7.0.0)
  redis (~> 4.0)
  selenium-webdriver
  sprockets-rails
  stimulus-rails
  tailwindcss-rails
  turbo-rails
  tzinfo-data
  web-console
  webdrivers

RUBY VERSION
   ruby 3.0.3p157

BUNDLED WITH
   2.3.4
find ~/.frum/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.3/exe

~/.frum/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.3/exe
~/.frum/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.3/exe/tailwindcss
bundle show --paths
.frum/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.3

Following the install steps worked but removed the -21.
rake gem:arm64-darwin

@juanmanuelramallo
Copy link
Author

@flavorjones thank you for the great pointers.

The issue was that I had BUNDLE_FORCE_RUBY_PLATFORM set to true in the global config file for bundler. As soon as I set that to false, and reinstalled the gems with bundler, I saw the expected output:

Installing tailwindcss-rails 2.0.2 (arm64-darwin)

Then when running rails tailwindcss:watch everything worked correctly without an issue.

@dinshaw-he check if you also have the BUNDLE_FORCE_RUBY_PLATFORM variable set in your ~/.bundle/config file.

@flavorjones
Copy link
Member

@juanmanuelramallo 👏 Thanks for closing the loop!

@dinshaw-he
Copy link

dinshaw-he commented Jan 4, 2022

check if you also have the BUNDLE_FORCE_RUBY_PLATFORM variable set in your ~/.bundle/config file.

I do! Nice find, thank you!

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 this pull request may close these issues.

4 participants