-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
bridgetown --help
raises an error outside of a Bridgetown project dir, if there's a Gemfile
#653
Comments
The So I don't really understand why this is happening. A quick Google search turns up a few similar issues:
This isn't necessarily a bridgetown problem. Could also be something with your setup. If you open |
I'd tried that before posting, and it worked. I also confirmed with |
Rake is bundled with ruby, see https://stdgems.org/3.1.0/ |
Sure, but how do you explain this?
(Note this is using Again, if I run Did you try to reproduce, using the steps I provided in my original post?
|
Alright, maybe we need to detect if that gem is installed and gate that code (listing of rake tasks) behind that check. https://makandracards.com/makandra/42521-detecting-if-a-ruby-gem-is-loaded Would you like to put together a PR for this issue? |
I would have already, if I understood exactly what's going on. The real question is: why would that (This PR shows Bridgetown introduces – or used to introduce – a Hmm, I think this is it:
The bridgetown/bridgetown-core/lib/bridgetown-core/plugin_manager.rb Lines 63 to 78 in a9649c4
To me, |
It might be interesting to look at Rails to understand how the gem's See for example:
|
This sounds like a likely culprit. |
Shouldn't crash anymore if the rake gem isn't available with PR #656 merged. |
Confirmed it's fixed in v1.2.0beta4. Thank you! |
I first commented on issue #608, as it felt the
cannot load such file -- rake
error was related enough, but then I realized it might be different enough, and the currently suggested fix did not change the outcome for me, so I decided to create an issue instead.Bridgetown Version: 1.1.0
To Reproduce
Current behavior
Bridgetown starts displaying the help text correctly, but when it comes to displaying the "Available Rake Tasks" sections, it craps out with an error:
Expected behavior
When I'm getting started with Bridgetown (or say I forgot the name of the Bridgetown command to start a new site), it shouldn't matter where I'm situated,
bridgetown --help
should work without displaying an error. (Maybe skip displaying rake tasks? Maybe detect it's not running in a Bridgetown project directory, and just display help forbridgetown new
, like Rails does?)Screenshots
Not applicable.
Computing environment (please complete the following information):
Additional context
I guess it doesn't matter much, I can get started and things should work once I
cd
into the site directory, but I thought I'd mention it. It doesn't feel great to get an error message when you're getting started. 😬The text was updated successfully, but these errors were encountered: