Emacs shell cannot find ruby ​​gems - for example, RubyGem haml (> = 0) (Gem :: LoadError) could not be found

My emacs shell cannot load any of my installed ruby ​​gems. I get Gem :: LoadError when I try to execute any installed gem from emacs, but it works with Terminal. Here is all the information that I viewed in my environment. Thanks for any help!

  • Running Emacs.app on my Mac OSX Snow Leopard (from emacsformacosx using universal dmg).
  • Installed RVM, then RVM is used to install Ruby 1.9.2 and 1.8.7.
  • Several gemstones are installed, including rails and haml.
  • Do not use root for these installations.

From the terminal (bash) I can run gems (e.g. haml somepage.haml or rails create someapp)

In emacs, I set the shell path (bash) to the same as the terminal shell (via ~ / .MacOSX / application.plist).

echo $PATH returns the same result from terminal and emacs

I can run IRB and rvm from emacs shell.

Running gem listemacs from the shell shows that I have haml installed (3.1.2, 3.1.1). Execution: which rvm, which gem, which haml#all returns the same path in the terminal and Emacs

When I try to execute a stone (e.g. haml), I get the following:

/Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:900:in report_activate_error': Could not find RubyGem haml (>= 0) (Gem::LoadError) from /Users/me/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:248:in activate 'from /Users/me/.rvm/rubies/ruby- 1.9.2-p180 / lib / ruby ​​/ site_ruby / 1.9.1 / rubygems.rb: 1276: ingem' from /Users/me/.rvm/gems/ruby-1.9.2-p180/bin/haml:18:in

+5
1

, GEM_HOME ​​ . rvm , bundler .

, , rvm.

+5

All Articles