lookbook-hq / lookbook

A UI development environment for Ruby on Rails apps ✨
https://lookbook.build
MIT License
913 stars 94 forks source link

all_view_paths undefined for ActionView::ViewPaths:Module #334

Closed charlesobrien closed 1 year ago

charlesobrien commented 1 year ago

Describe the bug

Rails (edge) won't start.

/usr/local/rvm/gems/default/gems/lookbook-2.0.0.beta.1/lib/lookbook/engine.rb:128:inview_paths': undefined method all_view_paths' for ActionView::ViewPaths:Module (NoMethodError) ActionView::ViewPaths.all_view_paths.flat_map do |view_path| from /usr/local/rvm/gems/default/gems/lookbook-2.0.0.beta.1/lib/lookbook/engine.rb:153:inpreview_watch_paths'`

To Reproduce

Steps to reproduce the behavior:

Run a Rails app using bin/rails server or bin/dev.

Expected behavior

Rails application should start.

Version numbers

Please complete the following information:

Additional context

Appears to be related to https://github.com/rails/rails/commit/28284fc186800ab13a9ee1b141fc32d065f85528

allmarkedup commented 1 year ago

Thanks for this @charlesobrien - I'll look into it and get it fixed up. I also really need to ensure the tests are running against Rails edge too.

Appreciate you taking time to report the issue and help point me in the right direction, I'll let you know when it's fixed 👍

allmarkedup commented 1 year ago

@charlesobrien I've just pushed a fix up for this and will get a new release out soon - thanks for bringing it to my attention!

For some reason I'm struggling to add Rails edge added to the test matrix but once I've figured that out it should hopefully guard against things like this in the future. I've tested this fix manually however and it should do the jpb.

Let me know how you get whenever manage to give it a try.

Spone commented 1 year ago

@allmarkedup what's the issue with testing against rails edge? I think we got it figured out on VC 's repo.

charlesobrien commented 1 year ago

@charlesobrien I've just pushed a fix up for this and will get a new release out soon - thanks for bringing it to my attention!

For some reason I'm struggling to add Rails edge added to the test matrix but once I've figured that out it should hopefully guard against things like this in the future. I've tested this fix manually however and it should do the jpb.

Let me know how you get whenever manage to give it a try.

Thanks, you're awesome! I'll pull main this weekend and give it a try.

allmarkedup commented 1 year ago

@charlesobrien great! Hopefully it's all fixed up :-)

allmarkedup commented 1 year ago

@Spone I'm not sure! Running appraisal install to generate the Gemfile always fails with a message about being unable to find actionpack 7.1 alpha. The VC repo works just fine for me so I'm not quite sure what is happening. Just trying to pick it apart now and see what might be different in the way I've got things set up in Lookbook.

charlesobrien commented 1 year ago

@charlesobrien great! Hopefully it's all fixed up :-)

Just pulled v2 branch. App starts and appears things are back in order. Will test a bit more later. Thank you!

allmarkedup commented 1 year ago

@charlesobrien fantastic - I'll close this issue down now then, thanks for letting me know :-)

Spone commented 1 year ago

@Spone I'm not sure! Running appraisal install to generate the Gemfile always fails with a message about being unable to find actionpack 7.1 alpha. The VC repo works just fine for me so I'm not quite sure what is happening. Just trying to pick it apart now and see what might be different in the way I've got things set up in Lookbook.

Here's the PR where everything's working (and tests are run through Appraisal in CI), if it can be of some help! https://github.com/ViewComponent/view_component/pull/1308

allmarkedup commented 1 year ago

Thanks @Spone - will take a look at that now

allmarkedup commented 1 year ago

@charlesobrien I've just realised that the previous fix masked the problem but didn't actually fix it correctly, so I've just pushed a new change that should properly fix it this time

Related: @spone - I've got it working now! 🎉 😆 Thanks.