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

Doesn't work on macOS (M1) #101

Closed
manastyretskyi opened this issue Dec 19, 2021 · 12 comments
Closed

Doesn't work on macOS (M1) #101

manastyretskyi opened this issue Dec 19, 2021 · 12 comments

Comments

@manastyretskyi
Copy link

Hello,
I have created new rails app with --css tailwind flag.
Neither rails tailwindcss:build nor rails tailwindcss:watch produce any output and fail silently.
TailwindCSS executable doesn't seem to be installed with gem.

In my case command that is executed under the hood looks like this:
/Users/user/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.0/lib/tasks/../../exe/tailwindcss -i /Users/user/project/app/assets/stylesheets/application.tailwind.css -o /Users/user/project/app/assets/builds/tailwind.css -c /Users/user/project/config/tailwind.config.js

And when I try to execute it manually I get:
zsh: no such file or directory: /Users/user/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.0/lib/tasks/../../exe/tailwindcss

@dhh
Copy link
Member

dhh commented Dec 19, 2021

What version of macOS are you? Latest?

@manastyretskyi
Copy link
Author

Yes, I'm using macOS Monterey 12.1 (21C52).

@manastyretskyi
Copy link
Author

Also I found other people complain about same issue #96 (comment) but this solution didn't work for me.

@dixpac
Copy link
Contributor

dixpac commented Dec 19, 2021

bundle show tailwindcss-rails should display something like .../gems/tailwindcss-rails-2.0.0-arm64-darwin, in your case it has installed gem without the platform..same issue I had but I'm on the BigSur 11.6.

Is that specific project where it doesn't work or it is not working at all?

@manastyretskyi
Copy link
Author

First I tried to add tailwindcss-rails to an existing project, but it didn't work, then I created new project using rails new test --css tailwind and it didn't work as well.

@dixpac
Copy link
Contributor

dixpac commented Dec 19, 2021

When you open irb (for that ruby version 3.0.0 as I can see) and inspect RUBY_PLATFORM

# irb console
RUBY_PLATFORM

What value does this constant prints?

@manastyretskyi
Copy link
Author

irb(main):001:0> RUBY_PLATFORM
=> "arm64-darwin21"

@flavorjones
Copy link
Member

I'll try to take a look today.

flavorjones added a commit to flavorjones/tailwindcss-rails that referenced this issue Dec 19, 2021
See rails#101 and comments in rails#96 for examples of what's confusing users.
dhh pushed a commit that referenced this issue Dec 19, 2021
…n't correct (#102)

* prefactor: expose constants related to upstream tailwindcss

The following constants have been moved from rakelib/package.rake into
lib/tailwindcss/upstream.rb to be accessible from within the installed
gem:

- TAILWINDCSS_VERSION → Tailwindcss::Upstream::VERSION
- TAILWINDCSS_NATIVE_PLATFORMS -> Tailwindcss::Upstream::NATIVE_PLATFORMS

* fix: provide more helpful error messages

See #101 and comments in #96 for examples of what's confusing users.
@flavorjones
Copy link
Member

See #102 for a potential fix

@dhh
Copy link
Member

dhh commented Dec 19, 2021

Addressed via #102 👍

@dhh dhh closed this as completed Dec 19, 2021
@manastyretskyi
Copy link
Author

After updating to version 2.0.1 I get this message:

ERROR: Cannot find the tailwindcss executable for arm64-darwin-21 in /Users/user/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.1/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.

After I ran suggested commands, tailwindcss-rails (2.0.1-arm64-darwin) is added to Gemfile.lock, but when I run rails tailwindcss:build I get the same message.

@manastyretskyi
Copy link
Author

manastyretskyi commented Dec 19, 2021

Update to my previous comment. After bundle lock --add-platform arm64-darwin-21 and bundle install two gem versions were added to the Gemfile.lock.

    tailwindcss-rails (2.0.2)
      railties (>= 6.0.0)
    tailwindcss-rails (2.0.2-arm64-darwin)
      railties (>= 6.0.0)

After I removed vanilla ruby version manually everything started to work.

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