将 ruby .gem 文件放在哪里以便 Shoes.setup 可以找到它们?
关于鞋子中的宝石支持,人们提出了很多问题,但没有人回答将它们放在哪里。 我在 Windows XP 上安装了 Shoes Raisins 1134,并且下载了 dbi-0.4.1.gem
并尝试执行以下操作:
Shoes.setup do
gem 'dbi'
end
require 'dbi'
Shoes.app
...
end
当我运行此程序时,我会看到以下对话框 :说Installing dbi -- Looking for dbi
,它坐了几个小时都没有找到gem文件。 我尝试将其放在以下所有位置均无济于事:
- 包含上述脚本的文件夹
- D:\Program Files\Common Files\Shoes\0.r1134\ruby\gems
- D:\Program Files\Common Files\ Shoes\0.r1134\ruby\gems\1.8\gems
哪个是错误的——文件夹还是代码?
编辑-答案:
感谢@Pesto 的回答。 我已经阅读了引用的文本,但将其误解为引用 Shoes PUT 安装的 gem 文件的位置,而不是它获取 gem 源的位置。 在 Windows XP 中,该引用将转换为 %USERPROFILE%\Application Data\Shoes
,并且安装工作完美。 现在开始玩它......
A lot of questions have been asked about gem support in Shoes, but none have answered where to put them. I've got Shoes Raisins 1134 on Windows XP, and I've downloaded dbi-0.4.1.gem
and am trying to get the following to work:
Shoes.setup do
gem 'dbi'
end
require 'dbi'
Shoes.app
...
end
When I run this, I get the dialog that says Installing dbi -- Looking for dbi
which sits for hours not finding the gem file. I've tried putting it in all of the following places to no avail:
- The folder that contains the above script
- D:\Program Files\Common Files\Shoes\0.r1134\ruby\gems
- D:\Program Files\Common Files\Shoes\0.r1134\ruby\gems\1.8\gems
Which is wrong -- the folder or the code?
EDIT - ANSWER:
Thanks to @Pesto for the answer. I had read the quoted text, but misunderstood it to reference where Shoes PUT the installed gem files, not where it GOT the gem source. In Windows XP, the reference translates to %USERPROFILE%\Application Data\Shoes
, and the install worked perfectly. Now to start playing with it ...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
代码看起来不错。 例如,这只是桃花:
至于宝石安装在哪里,_为什么他自己 回答了这个:
The code looks fine. For example, this is just peachy:
As to where the gems are installed, _why himself answers this:
每当您无法检查鞋子是否能够找到宝石时,您都可以在 ~/.shoes/+gem/gems 中查看鞋子可用的宝石
Anytime you have trouble checking whether shoes is able to find the gem or not, You can see the gems available to shoes at ~/.shoes/+gem/gems