-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make bundle exec inferno start
work
#502
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #502 +/- ##
=======================================
Coverage 79.70% 79.70%
=======================================
Files 240 240
Lines 11927 11927
Branches 1169 1169
=======================================
Hits 9506 9506
Misses 1757 1757
Partials 664 664
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
If this PR is approved and merged, then the documentation at https://github.com/inferno-framework/inferno-framework.github.io/blob/main/docs/getting-started/inferno-cli.md should be updated. That page specifically states that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work for me.
~/code/inferno (bundle-exec-inferno-start ✘)✭ ᐅ be bin/inferno start
I, [2024-06-18T08:37:38.872621 #90054] INFO -- : (0.000261s) PRAGMA foreign_keys = 1
I, [2024-06-18T08:37:38.872667 #90054] INFO -- : (0.000006s) PRAGMA case_sensitive_like = 1
bundler: failed to load command: bin/inferno (bin/inferno)
/Users/smacvicar/code/inferno/lib/inferno/apps/cli/main.rb:72:in `without_bundler': undefined local variable or method `block' for #<Inferno::CLI::Main:0x000000010a106a98 @_invocations={Inferno::CLI::Main=>["start"]}, @_initializer=[[], [], {:shell=>#<Thor::Shell::Color:0x000000010a1079e8 @base=#<Inferno::CLI::Main:0x000000010a106a98 ...>, @mute=false, @padding=0, @always_force=false>, :current_command=>#<struct Thor::Command name="start", description="Start Inferno", long_description=nil, usage="start", options={:watch=>#<Thor::Option:0x000000010a15cc68 @check_default_type=nil, @repeatable=false, @name="watch", @description="Automatically restart Inferno when a file is changed.", @required=false, @type=:boolean, @default=false, @banner=nil, @enum=nil, @lazy_default=nil, @aliases=[], @hide=nil, @human_name="watch", @switch_name="--watch">}, ancestor_name=nil>}], @options={"watch"=>false}, @args=[], @shell=#<Thor::Shell::Color:0x000000010a1079e8 @base=#<Inferno::CLI::Main:0x000000010a106a98 ...>, @mute=false, @padding=0, @always_force=false>> (NameError)
Bundler.with_unbundled_env(&block)
^^^^^
from /Users/smacvicar/code/inferno/lib/inferno/apps/cli/main.rb:31:in `start'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/thor-1.2.2/lib/thor/base.rb:485:in `start'
from bin/inferno:7:in `<top (required)>'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/cli/exec.rb:58:in `load'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/cli/exec.rb:58:in `kernel_load'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/cli/exec.rb:23:in `run'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/cli.rb:486:in `exec'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/cli.rb:31:in `dispatch'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/cli.rb:25:in `start'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/exe/bundle:48:in `block in <top (required)>'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.23/exe/bundle:36:in `<top (required)>'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/bin/bundle:25:in `load'
from /Users/smacvicar/.asdf/installs/ruby/3.1.2/bin/bundle:25:in `<main>'
It broke because of a bug in rubocop. I just disabled it where it mattered so |
Summary
IT WORKED! This is a rogue PR but please let this be a feature, maybe after the upcoming push to production. Putting up as draft (see TODOs below), but I'm not opposed to just merging it if people approve.
Testing Guidance
bundle exec bin/inferno services
bundle exec bin/inferno start
Possible TODOs:
It still outputs "You must install foreman with 'gem install foreman' prior to running Inferno" because it can't detect foreman in the bundler env, but then will still run anyways in non-bundler env. We can fix this with anotherResolvedif
but I'll try to do it in a cleaner way.