Open evenreven opened 2 years ago
Thanks for the report! Will try to get behind what's wrong
@julianrubisch Hey! Did you found out what happened? (Trying to solve it)
https://github.com/stimulusreflex/futurism/blob/master/lib/tasks/futurism_tasks.rake#L8-L13
This is not covering all of the possible locations the file could be, it either needs more paths or simply ask for user input if no file was found.
I fixed the issue by manually adding the file path (app/javascript/application.js
).
I would still advise doing a manual installation because this auto-install is assuming some stuff, which might not be the case for everyone.
In fairness, this was all written before importmaps-rails, jsbundling-Rails etc.
we‘re just in the process of streamlining all StimulusReflex and CableReady installers, futurism will come next 🤞
Nice find @SpaYco, I was looking in the wrong place. I guess this is the root of my issue? Rails 5.2 didn't use Webpacker by default, so app/javascript
doesn't exist unless you install it manually. And my legacy Rails app actually has been retrofitted to use vite_rails, which encourages using app/frontend/entrypoints
. Any chance this gem's installer could be less opinionated about this, @julianrubisch? I'm not asking that you should cover every edge case, but maybe a prompt if the standard locations aren't found? Thanks!
It definitely should and will. We’re just trying to reuse as much as possible between CR, SR, futurism and others
cc @marcoroth
Bug Report
I'm trying to add Futurism to a legacy Rails app running Rails 5.2, and I'm running into problems. Trying to recreate in a new 5.2 app has the same issues.
Describe the bug
Running
bin/rails futurism:install --trace
gives this error:Trace
``` ** Invoke futurism:install (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute futurism:install yarn add v1.22.17 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Saved 1 new dependency. info Direct dependencies └─ @stimulus_reflex/futurism@1.2.0-pre9 info All dependencies └─ @stimulus_reflex/futurism@1.2.0-pre9 Done in 2.67s. Updating rails aborted! TypeError: no implicit conversion of nil into String /home/user/.rbenv/versions/2.6.9/lib/ruby/gems/2.6.0/gems/futurism-1.1.0/lib/tasks/futurism_tasks.rake:19:in `initialize' /home/user/.rbenv/versions/2.6.9/lib/ruby/gems/2.6.0/gems/futurism-1.1.0/lib/tasks/futurism_tasks.rake:19:in `open' /home/user/.rbenv/versions/2.6.9/lib/ruby/gems/2.6.0/gems/futurism-1.1.0/lib/tasks/futurism_tasks.rake:19:in `block (2 levels) inTo Reproduce
Create a new Rails 5.2 install with actioncable, then bundle add futurism and bin/rails futurism:install
Expected behavior
I expected it to install, or to give an error message with more information on what went wrong.
Screenshots or reproduction
[see above]
Versions
Futurism
External tools
Browser
[not applicable]