TextMate 在 opt 中找不到我的 RSpec gem(来自 macports)
我知道我以前也遇到过这个问题,所以我真的很沮丧。
我已经为 TextMate 安装了 Ruby RSpec 捆绑包,但是当我运行行为描述或运行聚焦示例时,我收到这个奇妙的错误:(
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:
in `report_activate_error': Could not find RubyGem rspec (>= 1.1.0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:
in `activate' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby
/1.8/rubygems.rb:68:in `gem' from /Users/simon/Library/Application Support/TextMate/Bundles/Ruby
RSpec.tmbundle/Support/lib/spec_mate.rb:13 from /tmp/temp_textmate.oWRPUR:3:in `require'
from /tmp/temp_textmate.oWRPUR:3
我添加了换行符以使其可读)
我正在使用 macports,因此我的 rspec gem 安装在 <代码>/opt/local/lib/ruby/gems/1.8/gems/。为什么它找不到它?
在首选项>高级> Shell 变量我的 TM_RUBY
设置为 /opt/local/bin/ruby
。我也在这里尝试了这个技巧:
http://dnite。 org/2007/8/28/textmate-and-your-environment-variables/
...没有做任何事情。
I know I've had this problem before so I'm really frustrated.
I've got the Ruby RSpec bundle installed for TextMate, but when I Run Behaviour Description or Run Focused Example I get this wonderful error:
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:827:
in `report_activate_error': Could not find RubyGem rspec (>= 1.1.0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:261:
in `activate' from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby
/1.8/rubygems.rb:68:in `gem' from /Users/simon/Library/Application Support/TextMate/Bundles/Ruby
RSpec.tmbundle/Support/lib/spec_mate.rb:13 from /tmp/temp_textmate.oWRPUR:3:in `require'
from /tmp/temp_textmate.oWRPUR:3
(I added linebreaks to make it readable)
I'm using macports so my rspec gem is installed in /opt/local/lib/ruby/gems/1.8/gems/
. Why isn't it finding it?
In Preferences > Advanced > Shell Variables my TM_RUBY
is set to /opt/local/bin/ruby
. I also tried the trick here:
http://dnite.org/2007/8/28/textmate-and-your-environment-variables/
... which didn't do anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需添加一个指向您的 rspec 安装的 TM_RSPEC_HOME 变量即可。
Just add a TM_RSPEC_HOME variable pointing to your rspec install.
好吧,我能找到的唯一解决方案是不巧妙但有效的。
Well, the only solution I could find is unsubtle but works.
我刚刚在新安装 TextMate 和 Snow Leopard 时遇到了同样的问题。转到首选项>高级> Shell 变量和 TM_RUBY 一起,确保设置 PATH,以便您希望它找到的 ruby 位于第一个。
我使用 rvm,所以这个符号链接...
...允许我告诉 textmate 我的 PATH 上的第一个条目是
/usr/local/bin
:现在它总是找到
.rvm /bin/textmate_ruby
I just ran across this same issue with a new install of TextMate and Snow Leopard. Go to Preferences > Advanced > Shell Variables, and along with TM_RUBY, make sure PATH is set so the ruby you want it to find is first.
I use rvm, so this symbolic link...
...allows me to tell textmate that the first entry on my PATH is
/usr/local/bin
:Now it always finds
.rvm/bin/textmate_ruby