将 ruby​​ .gem 文件放在哪里以便 Shoes.setup 可以找到它们?

发布于 2024-07-19 15:30:48 字数 736 浏览 12 评论 0原文

关于鞋子中的宝石支持,人们提出了很多问题,但没有人回答将它们放在哪里。 我在 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 技术交流群。

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

发布评论

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

评论(2

慵挽 2024-07-26 15:30:48

代码看起来不错。 例如,这只是桃花:

Shoes.setup do
  gem 'RedCloth'
end

require 'RedCloth'

Shoes.app do
  para RedCloth.new('*awesome*').to_html
end

至于宝石安装在哪里,_为什么他自己 回答了这个

将您的宝石列表放入
Shoes.setup 块,你最终会
遇到鞋子弹出窗口
上面如果有任何宝石碰巧是
缺席的。 宝石安装在
~/.shoes,以避免需要超级用户
权利。 (只是为了让鞋子远离
避免扰乱你正常的 Ruby
东西。)

The code looks fine. For example, this is just peachy:

Shoes.setup do
  gem 'RedCloth'
end

require 'RedCloth'

Shoes.app do
  para RedCloth.new('*awesome*').to_html
end

As to where the gems are installed, _why himself answers this:

By putting your gem list in the
Shoes.setup block, you’ll end up
encountering the Shoes popup seen
above if any of the gems happens to be
absent. Gems are installed in
~/.shoes, to avoid needing superuser
rights. (And just to keep Shoes away
from messing with your normal Ruby
stuff.)

云巢 2024-07-26 15:30:48

每当您无法检查鞋子是否能够找到宝石时,您都可以在 ~/.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

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