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

Tailwind installation error #152

Closed
cirdes opened this issue Oct 5, 2024 · 3 comments
Closed

Tailwind installation error #152

cirdes opened this issue Oct 5, 2024 · 3 comments

Comments

@cirdes
Copy link
Collaborator

cirdes commented Oct 5, 2024

Rails: 8.0.0.beta
Ruby: 3.3.5
Importmaps

I was trying to use the install generator on a brand new rails app with Importmaps and got this error:

/Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/bundler/gems/rbui-2d7f30ea48ef/lib/generators/rbui/install/install_generator.rb:89:in `pin_rbui_js': undefined local variable or method `destination_path' for an instance of RBUI::Generators::InstallGenerator (NameError)

            template "#{template_dir}/index.js", "#{destination_path}/index.js" unless File.exist?("#{destination_path}/index.js")
                                                                                                      ^^^^^^^^^^^^^^^^
Did you mean?  destination_root
               destination_root=
               @destination_stack
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:134:in `block in invoke_all'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:134:in `each'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:134:in `map'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:134:in `invoke_all'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/group.rb:243:in `dispatch'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/base.rb:584:in `start'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/generators.rb:265:in `invoke'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/commands/generate/generate_command.rb:26:in `perform'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/command.rb:28:in `run'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor/invocation.rb:127:in `invoke_command'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/command/base.rb:178:in `invoke_command'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/thor-1.3.2/lib/thor.rb:538:in `dispatch'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/command/base.rb:73:in `perform'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/command.rb:71:in `block in invoke'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/command.rb:149:in `with_argv'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/command.rb:69:in `invoke'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/railties-8.0.0.beta1/lib/rails/commands.rb:18:in `<main>'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `require'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/3.3.0/bundled_gems.rb:75:in `block (2 levels) in replace_require'
        from /Users/cirdes/.asdf/installs/ruby/3.3.5/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from bin/rails:4:in `<main>'

@SethHorsley , maybe we should simplify the generator by just checking if Phlex and Tailwind are installed, and raise an error if they aren’t, instead of trying to install them.

Especially for Tailwind, it’s a bit tricky. When I ask the generator to reinstall it, it adds a lot of node files to my project that I wasn’t expecting.

Screenshot 2024-10-05 at 12 34 50
@cirdes
Copy link
Collaborator Author

cirdes commented Oct 5, 2024

I was answering "no" to everything to avoid reinstalling Phlex and Tailwind, but even then, I ended up with a lot of unexpected files added.

Screenshot 2024-10-05 at 12 39 00

@askehansen
Copy link

I created a pull request to add the missing destination_path and template_dir

#155

@SethHorsley
Copy link
Collaborator

fixed with #162.
try again with main and the installers should work. I'll upload an example repo with the correct importmaps.rb file.

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

3 participants