Skip to content
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

Fails to build with Ruby3.0. | Lock to Ruby2.7 #106

Closed
hinell opened this issue Nov 28, 2022 · 1 comment
Closed

Fails to build with Ruby3.0. | Lock to Ruby2.7 #106

hinell opened this issue Nov 28, 2022 · 1 comment

Comments

@hinell
Copy link

hinell commented Nov 28, 2022

# 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

  1. Run Debian/[K]Ubuntu 22.04.2
  2. Install Ruby3.0
  3. Follow instructions at learnxinyminutes/CONTRIBUTING.markdown
  4. 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
Copy link

Same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants