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

error messages on unsupported platforms or when bundler platforms aren't correct #102

Merged
merged 2 commits into from
Dec 19, 2021

Conversation

flavorjones
Copy link
Member

what problem is being solved

See #101 and comments in #96 to see some problems users are having where either:

  • the ruby platform (vanilla) gem is installed and so tailwindcss is simply not found in the user's path
  • bundler's lockfile needs to be updated with the current platform

what changes are being made

This PR introduces two changes:

  • upstream tailwindcss metadata are moved from the rakefile into lib/tailwindcss/upstream.rb for use by the gem
  • the exe/tailwindcss script is always shipped with the gem

An job is added to the gem-install actions pipeline to test the scenario where a bundler lockfile needs to have the native platform added.

what will users see

The net result is that when someone has the "ruby" platform vanilla gem installed because their platform is not supported, they will see this error message when they run "tailwindcss":

ERROR: tailwindcss-rails does not support the <platformname> platform
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation

When someone has the "ruby" platform vanilla gem installed because their bundler lockfile does not contain the current system's platform, they will see this error message when they run "tailwindcss":

ERROR: Cannot find the tailwindcss executable for x86_64-linux in /home/flavorjones/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/tailwindcss-rails-2.0.0/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 x86_64-linux
  bundle install

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

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
See rails#101 and comments in rails#96 for examples of what's confusing users.
@dhh dhh merged commit 22e1a01 into rails:main Dec 19, 2021
@flavorjones flavorjones deleted the flavorjones-unsupported-platform-help branch December 19, 2021 20:06
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.

2 participants