Search code examples
rubyrbenvmiddleman

Middleman installed but binary cannot be found


I just installed Middleman on my Mac (OS 10.8.2) but am unable to generate a new project. I have Xcode installed. Can anyone tell me what I might have done wrong?

$ middleman init moi
-bash: middleman: command not found
$ gem list
middleman (3.0.12)
middleman-core (3.0.12)
middleman-more (3.0.12)
middleman-sprockets (3.0.9)
$ ruby -v
ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-darwin12.2.0]

I'm using rbenv. This is my path:

/Users/me/.rbenv/shims:/opt/local/bin:/opt/local/sbin:/Users/me/downloads/mongodb/bin:/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

Solution

  • If you’ve just installed a new gem in a Ruby installation managed by rbenv, you should run

    rbenv rehash
    

    after installing. This generates the shims for the newly-installed gem that will allow you to run it. You can read more in rbenv’s readme.