views:

251

answers:

4

in `gem_original_require': no such file to load -- haml (MissingSourceFile)

but this gem already istalled.

I have also plugin for this path :-/home/techvant/rails_app/techease/vendor/plugins/haml/init.rb

this init file having following code : -

begin
     require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
   rescue LoadError
     require 'haml' # From gem
end

what I need to resolve this error please help.

following is the error trace.

/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- haml (MissingSourceFile) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:innew_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in require' from /home/techvant/rails_app/techease/vendor/plugins/haml/init.rb:4:inevaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:146:in evaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:insilence_warnings' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:142:in evaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:48:inload' from /home/techvant/rails_app/techease/config/../vendor/plugins/siteninja/engines/lib/engines/plugin.rb:77:in load' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:inload_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in each' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:inload_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:348:in load_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:163:inprocess' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:inrun' from /home/techvant/rails_app/techease/config/environment.rb:9 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:innew_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3

A: 

Try:

gem update rails

...on the server, not your development machine

Mick Sharpe
A: 

you can try to unpack the gems so they are inside your rails app directory, this will eliminate your rails app from depending on local gems in your system. cheers!

westoque
+1  A: 

Since haml is a gem, I'd put it in environment.rb:

config.gem 'haml'

Then, unpack and add it to the repo:

rake gems:install
rake gems:unpack

Finally, remove the haml plugin references you've got.

wesgarrison
A: 

I had a great deal of trouble with this problem as well. Here are the steps I finally took to solve it.

First, install the gem.

put

config.gem 'haml' 

in your environment.rb file. I actually had to put it in my environments/development.rb and environments/production.rb (etc.) as it was complaining about not knowing the rails_env. Which is not optimal, but it worked. then run

rake gems:install

Then

mkdir -p /vendor/plugins/haml
cp vendor/gems/haml-2.2.0/init.rb /vendor/plugins/haml/init.rb

then restart your rails server.

Slabgorb