middleman: "uninitialized constant Haml::Options" error while launching Middleman server on a fresh install
I tried creating a fresh new Middleman project and launching the server.
$ gem install middleman
$ mkdir project
$ middleman init
$ middleman server
Command middleman server fails to launch giving the following error message:
/Users/username/.rvm/gems/ruby-3.1.2/gems/middleman-core-4.4.2/lib/middleman-core/renderers/haml.rb:49:in `initialize': uninitialized constant Haml::Options (NameError)
::Haml::Options.defaults[:context] = nil
Iām also getting the same error message this way.
$ gem install middleman
$ middleman init project
Additional information
- Ruby version: 3.1.2 installed via RVM
- Middleman version: 4.2.2
- OS version: macOS 12.5
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 15 (8 by maintainers)
Commits related to this issue
- Lock haml to < 6.0 6.0 introduces breaking changes (see #2569) — committed to zofrex/middleman by zofrex 2 years ago
- Lock haml to < 6.0 6.0 introduces breaking changes (see #2569) — committed to zofrex/middleman by zofrex 2 years ago
- Lock haml to < 6.0 (#2570) 6.0 introduces breaking changes (see #2569) — committed to middleman/middleman by zofrex 2 years ago
- Fix issue with haml version https://github.com/middleman/middleman/issues/2569 — committed to tim-vandecasteele/lauranne-paulissen by tim-vandecasteele 2 years ago
- Revert "chore(deps): Bump haml from 5.2.2 to 6.0.3" This reverts commit 21d1e10a49e6a356316bf0b771246977b79ebafc. Because of incompatibility with middleman. https://github.com/middleman/middleman/is... — committed to qnyp/qnyp-company by deleted user 2 years ago
- Upgrade bundle, using middleman from github to work around https://github.com/middleman/middleman/issues/2569 — committed to betesh/hebrewCalendar.js by betesh 2 years ago
I also prepared a backport to the current
4.xbranch https://github.com/middleman/middleman/pull/2590. Please consider merging (and releasing) it before or after the rename.As a temporary workaround you can fix this in any project using a Gemfile by limiting the version of haml in your Gemfile, for example:
Published as v4.4.3 https://rubygems.org/gems/middleman/versions/4.4.3
Hello everyone šš¼ The fix was already merged (in both branches, 4.x and 5.x), but still not released, see:
4.xhttps://github.com/middleman/middleman/pull/25705.xhttps://github.com/middleman/middleman/pull/2571In the meantime, you can point the gem to GitHub
4.xbranch:Or if you are already using on
5.x:Same issue.
Same as above -
middleman initis throwing the same error for me