TextMate 在 opt 中找不到我的 RSpec gem(来自 macports)

发布于 2024-08-28 15:41:25 字数 1139 浏览 6 评论 0原文

我知道我以前也遇到过这个问题,所以我真的很沮丧。

我已经为 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

时间你老了 2024-09-04 15:41:25

只需添加一个指向您的 rspec 安装的 TM_RSPEC_HOME 变量即可。

Just add a TM_RSPEC_HOME variable pointing to your rspec install.

自此以后,行同陌路 2024-09-04 15:41:25

好吧,我能找到的唯一解决方案是不巧妙但有效的。

% cd /usr/bin/
% sudo mv ruby moved.ruby
% sudo ln -s /opt/local/bin/ruby ruby

Well, the only solution I could find is unsubtle but works.

% cd /usr/bin/
% sudo mv ruby moved.ruby
% sudo ln -s /opt/local/bin/ruby ruby
泪痕残 2024-09-04 15:41:25

我刚刚在新安装 TextMate 和 Snow Leopard 时遇到了同样的问题。转到首选项>高级> Shell 变量和 TM_RUBY 一起,确保设置 PATH,以便您希望它找到的 ruby​​ 位于第一个。

我使用 rvm,所以这个符号链接...

/usr/local/bin/ruby -> /Users/jjulian/.rvm/bin/textmate_ruby

...允许我告诉 textmate 我的 PATH 上的第一个条目是 /usr/local/bin

PATH  /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

现在它总是找到 .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...

/usr/local/bin/ruby -> /Users/jjulian/.rvm/bin/textmate_ruby

...allows me to tell textmate that the first entry on my PATH is /usr/local/bin:

PATH  /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Now it always finds .rvm/bin/textmate_ruby

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文