How to fix - undefined method `register' for Middleman::PhpExtension:Class (NoMethodError)?
sdey-s1 opened this issue · comments
Expected behavior and actual behavior
I'm trying to update middleman version(3.4.1 -> 4.4.3) in my project. I'm using bundle version(2.3.26), and ruby(2.7.7). After upgrading when trying to run - bundle exec middleman, I'm getting the below error. My project is in macos system.
bundler: failed to load command: middleman (/Users/suparna.dey/Dev/ProjectB/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman) Traceback (most recent call last): 27: from /opt/homebrew/opt/ruby@2.7/bin/bundle:23:in
26: from /opt/homebrew/opt/ruby@2.7/bin/bundle:23:in
load' 25: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/exe/bundle:36:in
<top (required)>'24: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in
with_friendly_errors' 23: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/exe/bundle:48:in
block in <top (required)>'22: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in
start' 21: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in
start'20: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in
dispatch' 19: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in
dispatch'18: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in
invoke_command' 17: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in
run'16: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in
exec' 15: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in
run'14: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in
kernel_load' 13: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in
load'12: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman:25:in
<top (required)>' 11: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bin/middleman:25:in
load'10: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-cli-4.4.3/bin/middleman:10:in
<top (required)>' 9: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.4.3/lib/middleman-core/load_paths.rb:15:in
setup_load_paths'8: from /Users/suparna.dey/Dev/BotSink/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/gems/middleman-core-4.4.3/lib/middleman-core/load_paths.rb:35:in
setup_bundler' 7: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler.rb:186:in
require'6: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in
require' 5: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:44:in
each'4: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in
block in require' 3: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:55:in
each'2: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in
block (2 levels) in require' 1: from /opt/homebrew/lib/ruby/gems/2.7.0/gems/bundler-2.3.26/lib/bundler/runtime.rb:60:in
require'/Users/suparna.dey/Dev/ProjectB/main/src/user_interface/frontend_ui/dev/vendor/bundle/ruby/2.7.0/bundler/gems/middleman-php-b4a6864f4a91/lib/middleman-php.rb:4:in
<top (required)>': undefined method
register' for Middleman::PhpExtension:Class (NoMethodError)`
Additional information
- Ruby version: 2.6.10
- Middleman version: 4.4.3
- OS version: MACOS 12.6
That seems an error of 3rd party code: Middleman::PhpExtension
. Maybe this plugin https://github.com/lord/middleman-php? Which seems a bit outdated btw...
@tdreyno I think we can close it, as it's not an error on MM itself, but a plugin.