Error after installation: cannot load such file -- addressable (LoadError)

I’m trying to install Middleman on Ubuntu 16.04, but when I try to create a new project, I receive the following error:

$ middleman init MY_PROJECT
/usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- addressable (LoadError)
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in `require'
	from /var/lib/gems/2.3.0/gems/middleman-core-4.1.8/lib/middleman-core/util/paths.rb:5:in `<top (required)>'
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /var/lib/gems/2.3.0/gems/middleman-core-4.1.8/lib/middleman-core/util.rb:10:in `<top (required)>'
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /var/lib/gems/2.3.0/gems/middleman-core-4.1.8/lib/middleman-core.rb:13:in `<top (required)>'
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /usr/local/lib/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
	from /var/lib/gems/2.3.0/gems/middleman-cli-4.1.8/bin/middleman:12:in `<top (required)>'
	from /usr/local/bin/middleman:22:in `load'
	from /usr/local/bin/middleman:22:in `<main>'

I installed a bunch of packages for building with sudo apt install build-essentials ruby-dev ruby2.3-dev ruby-build, but with no success.

$ ruby -v
ruby 2.3.0p0 (2015-12-25) [x86_64-linux-gnu]

Looking at the list of gems, addressable seems to be there:

$ gem list

*** LOCAL GEMS ***

activesupport (4.2.6)
addressable (2.3.8)
<...>
middleman (4.1.8)
middleman-cli (4.1.8)
middleman-core (4.1.8)
<...>

Any idea, what I’m missing?

Heya! I also had the same problem. Apparently, it’s a problem that has a work around:

You can fix it by
sudo gem install fastimage
then
sudo gem install addressable
finally
sudo gem install middleman

Hope this solves your issue like it did with me :slight_smile:

I personally solved running: gem update and gem clean.

Thank you! This helped and it’s working now.