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

时间:2022-07-23 15:08:40

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:

关于鞋子中的宝石支持已经提出了很多问题,但没有人回答在哪里放置它们。我已经在Windows XP上获得了鞋子Raisins 1134,我已经下载了dbi-0.4.1.gem并且我正在努力让以下工作:

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:

当我运行这个时,我得到一个对话框,上面写着安装dbi - 寻找dbi,这个dbi几个小时都找不到宝石文件。我试过把它放在以下所有地方都无济于事:

  • 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

  • D:\Program Files\Common Files\Shoes\0.r1134\ruby\gems\1.8\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 ...

感谢@Pesto的答案。我已经阅读了引用的文字,但误解了它引用了鞋子PUT已安装的宝石文件,而不是GOT宝石来源的地方。在Windows XP中,引用转换为%USERPROFILE%\ Application Data \ Shoes,并且安装工作正常。现在开始玩吧......

2 个解决方案

#1


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.)

通过将您的宝石列表放在Shoes.setup块中,如果任何宝石恰好不存在,您将最终遇到上面显示的鞋子弹出窗口。宝石安装在〜/ .shoes中,以避免需要超级用户权限。 (并且只是为了让鞋子远离你正常的Ruby东西。)

#2


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

任何时候你都无法检查鞋子是否能找到宝石,你可以在〜/ .shoes / + gem / gems看到鞋子可用的宝石

#1


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.)

通过将您的宝石列表放在Shoes.setup块中,如果任何宝石恰好不存在,您将最终遇到上面显示的鞋子弹出窗口。宝石安装在〜/ .shoes中,以避免需要超级用户权限。 (并且只是为了让鞋子远离你正常的Ruby东西。)

#2


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

任何时候你都无法检查鞋子是否能找到宝石,你可以在〜/ .shoes / + gem / gems看到鞋子可用的宝石