middleman / middleman

Hand-crafted frontend development
https://middlemanapp.com
MIT License
7.05k stars 748 forks source link

require': cannot load such file -- thread_safe (LoadError) when running any middleman command #1342

Closed brpaz closed 10 years ago

brpaz commented 10 years ago

When I try to create a new middleman project (using middleman init command) I allways get the following error. I had another middleman project already set up and if I run middleman commands inside that project it works fine.

What I am missing?

/home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require': cannot load such file -- thread_safe (LoadError)
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/notifications/fanout.rb:2:in `<top (required)>'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/notifications.rb:2:in `<top (required)>'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/util.rb:2:in `<top (required)>'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core.rb:13:in `<top (required)>'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-blog-3.4.1/lib/middleman-blog.rb:1:in `<top (required)>'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:144:in `require'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/extensions.rb:66:in `block in load_extensions_in_path'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/extensions.rb:65:in `each'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/extensions.rb:65:in `load_extensions_in_path'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/lib/middleman-core/load_paths.rb:39:in `setup_load_paths'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/gems/1.9.1/gems/middleman-core-3.3.3/bin/middleman:10:in `<top (required)>'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/bin/middleman:23:in `load'
    from /home/bruno/.rvm/rubies/ruby-1.9.3-p448/bin/middleman:23:in `<main>'
    from /home/bruno/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `eval'
    from /home/bruno/.rvm/gems/ruby-1.9.3-p448/bin/ruby_executable_hooks:15:in `<main>'
tdreyno commented 10 years ago

Looks like an installed Middleman extension might be acting up. When Middleman is run inside a project, it uses Bundler to protect itself from these kind of issues. Unfortunately, outside a project, it has to run through Rubygems which has all kinds of issues.

Like, you have a global gem with the middleman- prefix that is causing some issues. I'd suggest running gem list | grep middleman and uninstall anything that you don't need for middleman init. So, just keep middleman-core and middleman unless you're using a middleman- prefixed template gem.

brpaz commented 10 years ago

I uninstalled all middleman related gems and reinstalled middleman and now everything works fine again. Thanks.