关于鞋子中 gem 支持的问题很多,但没有人回答将它们放在哪里。我在 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
,安装工作完美。现在开始玩它......
最佳答案
代码看起来不错。例如,这只是桃色的:
Shoes.setup do
gem 'RedCloth'
end
require 'RedCloth'
Shoes.app do
para RedCloth.new('*awesome*').to_html
end
至于gems安装在哪里,_why自己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.)
关于ruby - 在哪里放置 ruby .gem 文件以便 Shoes.setup 可以找到它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/825331/