Trying Middleman for the first time, install fails

It sounded so easy.
gem install middleman
middleman init

Yeah except it’s not working. This is the error message I get. I literally didn’t do anything else. I tried to resolve this error using the internets for the past hour, no luck. This is very, very frustrating.

I am using OS X El Capitan
I installed Ruby using brew install Ruby because the El Cap version requires sudo to install gems.

Macintosh-2:nik$ middleman init 
WARN: Unresolved specs during Gem::Specification.reset:
      minitest (~> 5.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
/usr/local/lib/ruby/gems/2.3.0/gems/middleman-cli-4.1.1/bin/middleman:12:in `require': cannot load such file -- middleman-cli (LoadError)
	from /usr/local/lib/ruby/gems/2.3.0/gems/middleman-cli-4.1.1/bin/middleman:12:in `<top (required)>'
	from /usr/local/bin/middleman:23:in `load'
	from /usr/local/bin/middleman:23:in `<main>'

You may have multiple versions of middleman installed. Please paste the output of gem list here.

The following worked for me (on Windows, YMMV):

Add to your gemfile:
gem ‘middleman-cli’
gem ‘middleman-core’

re-run “bundle install”

1 Like

Macintosh-2:gems nik$ gem list

*** LOCAL GEMS ***

activesupport (4.2.5.1)
addressable (2.4.0)
backports (3.6.8)
bigdecimal (1.2.8)
bundler (1.11.2)
capybara (2.5.0)
coffee-script (2.4.1)
coffee-script-source (1.10.0)
compass-import-once (1.0.5)
concurrent-ruby (0.9.2)
contracts (0.12.0)
did_you_mean (1.0.0)
erubis (2.7.0)
execjs (2.6.0)
fast_blank (1.0.0)
fastimage (1.8.1)
ffi (1.9.10)
haml (4.0.7)
hamster (2.0.0)
hashie (3.4.3)
i18n (0.7.0)
io-console (0.4.5)
json (1.8.3)
kramdown (1.9.0)
listen (3.0.6)
middleman (4.1.1)
middleman-cli (4.1.1)
middleman-core (4.1.1)
mime-types (3.0)
mime-types-data (3.2015.1120)
mini_portile2 (2.0.0)
minitest (5.8.4)
net-telnet (0.1.1)
nokogiri (1.6.7.2)
padrino-helpers (0.13.1)
padrino-support (0.13.1)
parallel (1.6.1)
power_assert (0.2.7, 0.2.6)
psych (2.0.17)
rack (1.6.4)
rack-test (0.6.3)
rake (10.5.0, 10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.7)
rdoc (4.2.2, 4.2.1)
sass (3.4.21)
test-unit (3.1.7, 3.1.5)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)
uglifier (2.7.2)
xpath (2.0.0)

@btwelch I tried that, no effect. Also it does report these things are installed…

I have the same problem as written above, on Windows 7, and I have realized that I have two versions of Middleman. What should I do? Thanks!

I don’t have a windows computer. You could use https://zammu.in or a template like https://zammu.in/themes/danielbayerlein:middleman-casper to build stuff on Zammu (Full disclosure: I am the founder). This would run the build on the ‘zammu server’ so you shouldn’t have any problems.

Trying to do this again…

I actually had one version of middleman in
/Library/Ruby/Gems/2.0.0/gems/
And one in
/usr/local/lib/ruby/gems/2.3.0/gems/middleman-cli-4.1.3/bin/middleman
And one in
/usr/local/lib/ruby/gems/2.3.0/gems/middleman-cli-4.1.1/bin/middleman
(different version)

So this was a mess - sorry!

I now deleted everything except
/usr/local/lib/ruby/gems/2.3.0/gems/middleman-cli-4.1.3
/usr/local/lib/ruby/gems/2.3.0/gems/middleman-4.1.3
/usr/local/lib/ruby/gems/2.3.0/gems/middleman-core-4.1.3

I still get the same error.

But I noticed something strange - if I do “middleman init” inside the gems directory, it works. So now I am thinking it’s a paths problem, somehow something isn’t looking in the right places.

Ok so this was all my own fault, please ignore.

Even after I thought I had deleted all middleman installs, there were some left. I found them all with

gem list middleman*

Then I went to uninstall them all with gem uninstall, and then re-installed it, and it all works now.

Works for my. Thanks