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

Install fails when project uses rails/tailwindcss-rails #1806

Open
dinclas opened this issue Jan 28, 2023 · 1 comment
Open

Install fails when project uses rails/tailwindcss-rails #1806

dinclas opened this issue Jan 28, 2023 · 1 comment

Comments

@dinclas
Copy link

dinclas commented Jan 28, 2023

Precheck

  • Do not use the issues tracker for help or support, try Stack Overflow.
  • For bugs, do a quick search and make sure the bug has not yet been reported
  • If you found a security bug, do not report it through GitHub. Please send an e-mail to heartcombo@googlegroups.com instead.
  • Finally, be nice and have fun!

Environment

  • Ruby 3.0.0
  • Rails 7.0.4.2
  • Simple Form 5.1.0
  • tailwindcss-rails 2.0.21

Current behavior

Using tailwindcss-rails causes install to fail. Output:

❯ rails generate simple_form:install

[Simple Form] Simple Form is not configured in the application and will use the default values. Use `rails generate simple_form:install` to generate the Simple Form configuration.
SimpleForm 3 supports Bootstrap and Zurb Foundation 5. If you want a configuration that is compatible with one of these frameworks, then please re-run this generator with --bootstrap or --foundation as an option.
      create  config/initializers/simple_form.rb
       exist  config/locales
      create  config/locales/simple_form.en.yml
Could not find "_form.html.tailwindcss" in any of your source paths. Your current source paths are:
/Users/claudioramos/.rvm/gems/ruby-3.0.0/gems/simple_form-5.1.0/lib/generators/simple_form/templates

This can be reproduced by creating a new project using Tailwind and installing simple form.

rails new simple-form-tailwind-demo --css tailwind && cd simple-form-tailwind-demo
echo "gem 'simple_form'" > Gemfile
bin/bundle
bin/rails generate simple_form:install

Expected behavior

rails generate simple_form:install is expected to identify the template engine correctly and run successfully.

Workaround

Specify the template engine(erb, haml, or slim) in the install command.
Example: rails generate simple_form:install -e erb

@dinclas
Copy link
Author

dinclas commented Feb 9, 2023

This is caused by tailwind-rails setting the template engine as tailwindcss. I've opened an issue there.
rails/tailwindcss-rails#246

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant