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

Cannot install ActionText due to missing binstubs #40184

Closed
stevenbuccini opened this issue Sep 5, 2020 · 6 comments · Fixed by #40190
Closed

Cannot install ActionText due to missing binstubs #40184

stevenbuccini opened this issue Sep 5, 2020 · 6 comments · Fixed by #40190

Comments

@stevenbuccini
Copy link

stevenbuccini commented Sep 5, 2020

Steps to reproduce

  1. Create a new Rails app off of rails master using rails new
  2. bundle install
  3. bin/rails action_text:install as described on the Edge Guides.

Expected behavior

Rails should run the ActionText generator. Note that on master@e53f5ff, I was able to run the generator after overcoming the issue described in #37824.

Actual behavior

$ bin/rails action_text:install
       rails  app:binstub:yarn
rails aborted!
Don't know how to build task 'app:binstub:yarn' (See the list of available tasks with `rails --tasks`)

(See full trace by running task with --trace)

System configuration

Rails version: master@942c41806443

Ruby version: 2.7.1

@stevenbuccini stevenbuccini changed the title Cannot install ActionText due to missing binstubs. Cannot install ActionText due to missing binstubs Sep 5, 2020
@eugeneius
Copy link
Member

eugeneius commented Sep 5, 2020

Thanks for reporting this! git bisect leads to #40143. @jonathanhefner it looks like we might need to use your backup plan.

@stevenbuccini
Copy link
Author

stevenbuccini commented Sep 5, 2020

@eugeneius Do you mind sharing the steps you took to use git bisect to find the commit? I'm having trouble doing it on my own. This will help me report issues more accurately in the future. Thanks!

@eugeneius
Copy link
Member

eugeneius commented Sep 5, 2020

Sure: I generated a new application and changed the Gemfile to use my local checkout of Rails:

gem 'rails', path: '../../lib/rails'

I switched the Rails repository to the commits you mentioned, and verified that running bin/rails action_text:install in the test application worked on the first commit and failed on the second.

Then I used git bisect in the Rails repository, running bin/rails action_text:install in the test application for each commit to check whether it was good or bad.

Let me know if that works for you!

@jonathanhefner
Copy link
Member

jonathanhefner commented Sep 5, 2020

Looks like we found what made me think load "rails/tasks.rb" was necessary when implementing #39137. 🙃

@jonathanhefner jonathanhefner self-assigned this Sep 5, 2020
jonathanhefner added a commit to jonathanhefner/rails that referenced this issue Sep 6, 2020
Follow-up to rails#40143.

Rails Rake tasks are loaded for each new `Rake::Application` instance
via `Rails.application.load_tasks`.  However, under the hood,
`Rails.application.load_tasks` used `require` instead of `load`, which
caused Rails tasks to be loaded for only the first `Rake::Application`
instance.

This commit changes the relevant `require` to `load`.

Fixes rails#40184.
@abhaynikam
Copy link
Contributor

abhaynikam commented Sep 7, 2020

To tackle such issues, I went ahead and wrote some specs for the ActionText generator here #39317. If we could consider or alteast close it(if not required) I'll be happy to see some closure 😊

@jonathanhefner
Copy link
Member

jonathanhefner commented Sep 7, 2020

@abhaynikam In this case, I don't think #39317 would have helped because it stubs the call to app:binstub:yarn. But I think it would be nice to have more test coverage anyway, so I left a few comments there. 👍

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

Successfully merging a pull request may close this issue.

4 participants