← homeProgramming (Програмування)

[FIXED] cannot load such file -- html/pipeline (LoadError) occurs during rails generate thredded:install

Fix the error cannot load such file -- html/pipeline (LoadError) that occurs during rails generate thredded:install (when installing the thredded library to an existing Rails application).

This content has been automatically translated from Ukrainian.
How to fix the startup error rails generate thredded:install?
~/Desktop/sandbox rails generate thredded:install

/Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require': cannot load such file -- html/pipeline (LoadError)
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thredded-1.1.0/lib/thredded.rb:8:in `<main>'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/zeitwerk-2.6.7/lib/zeitwerk/kernel.rb:38:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler/runtime.rb:55:in `each'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler/runtime.rb:55:in `block in require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler/runtime.rb:44:in `each'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler/runtime.rb:44:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bundler-2.3.15/lib/bundler.rb:187:in `require'
  from /Users/username/Desktop/sandbox/config/application.rb:7:in `<main>'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command/actions.rb:22:in `require_application!'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands/generate/generate_command.rb:21:in `perform'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thor-1.2.1/lib/thor/command.rb:27:in `run'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thor-1.2.1/lib/thor/invocation.rb:127:in `invoke_command'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thor-1.2.1/lib/thor.rb:392:in `dispatch'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command/base.rb:87:in `perform'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/command.rb:48:in `invoke'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.4.3/lib/rails/commands.rb:18:in `<main>'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  from /Users/username/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
  from bin/rails:4:in `<main>'
To fix it, we add the gem to our Gemfile:
gem 'html-pipeline', '~> 2.14'
gem 'thredded', '~> 1.1'
We run bundle and try again:
rails generate thredded:install
      create  config/initializers/thredded.rb~/Desktop/sandbox
Everything works :) 

🔥 More posts

All posts