Skip to content

Show more useful link for unsupported platform error #23

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

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ gem install tailwindcss-ruby

### Using a local installation of `tailwindcss`

If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a local installation of the `tailwindcss` executable by setting an environment variable named `TAILWINDCSS_INSTALL_DIR` to the directory path containing the executable.
<!-- note that this section's title is deeplinked from an error message, do not change -->

If you are not able to use the vendored standalone executables (for example, if you're on an unsupported platform), you can use a [local installation](https://tailwindcss.com/docs/installation) of the `tailwindcss` executable by setting an environment variable named `TAILWINDCSS_INSTALL_DIR` to the directory path containing the executable.

For example, if you've installed `tailwindcss` so that the executable is found at `/path/to/node_modules/bin/tailwindcss`, then you should set your environment variable like so:

Expand Down
3 changes: 2 additions & 1 deletion lib/tailwindcss/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ def executable(exe_path: DEFAULT_DIR)
if Tailwindcss::Ruby::Upstream::NATIVE_PLATFORMS.keys.none? { |p| Gem::Platform.match_gem?(Gem::Platform.new(p), GEM_NAME) }
raise UnsupportedPlatformException, <<~MESSAGE
#{GEM_NAME} does not support the #{platform} platform
Please install tailwindcss following instructions at https://tailwindcss.com/docs/installation
See https://github.com/flavorjones/tailwindcss-ruby#using-a-local-installation-of-tailwindcss
for more details.
MESSAGE
end

Expand Down