Fails to build with Ruby3.0. | Lock to Ruby2.7
Closed this issue · 1 comments
hinell commented
# Gemfile
ruby "~>2.7"
...
gem 'nokogiri', '~> 1.11.2'
...
Why not to use Jekyll? I'm trying to build the learnxinyminutes-site by using Ruby3.0 and it fails due to differences in standard lib that is used by middleman
deps.
Expected
- Effortless & fast build
Actual behavior
- A lot of incompatibility errors
- Wasted over 2 hours to just to figure out that I have to downgrade ruby & bundler and install all deps
Steps to reproduce
- Run Debian/[K]Ubuntu 22.04.2
- Install Ruby3.0
- Follow instructions at learnxinyminutes/CONTRIBUTING.markdown
- Fails to build website
Additional information
- Ruby version: 3.0
- Middleman version: 3.3
- OS version: [K]Ubuntu 22.04.2 LTS
Workaround
On Linux/Ubuntu systems with fresh updates you have to install ruby2.7
anyway:
sudo apt install ruby2.7 ruby2.7-dev
Update your Gemfile. Update nokogiri
. See related PR nokogiri#2106
# Gemfile
source 'http://rubygems.org'
ruby "~>2.7"
gem "rouge"
gem "pygments.rb"
gem "middleman", "~>3.4.0"
gem "middleman-syntax", "~>3.3.0"
gem "redcarpet", "2.3.0"
gem "haml", "~>4.0.5"
# For feed.xml.builder
gem "builder", "~> 3.0.0"
# Github security recommendations
gem 'yajl-ruby', '~> 1.3.1'
gem 'nokogiri', '~> 1.11.2'
In your shell, run:
sudo gem2.7 install bundler -v '1.17.3'
sudo bundle2.7 install
bundle2.7 exec middleman
Note: The last command may leak memory somehow.
nopeless commented
Same