且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

鞋和宝石,以及如何让他们工作

更新时间:2023-11-23 07:59:04

原生扩展的Gem将无法工作。这就是说,机械化应该。但是,有时在OSX上,gem安装对话框会挂起,我还没有完全弄明白为什么。这可能是你正在经历的。 :/ b /

其次,鞋子没有配备Nokogiri,它带有h​​pricot。不过,我们计划在未来的版本中转向nokogiri。它也不包含RedCloth。

I have seen this question asked all over the internet and answered in many different ways. None of them seem to be working for me.
I am trying to get Gems to work in Shoes (specifically the gem Mechanize).
Whenever I use the code:

Shoes.setup do
   gem 'mechanize'
end

require 'mechanize'

It gives me the popup that says it is installing native extensions and sits at that screen for 30 minutes and longer (I've only ever waited as long as 30 minutes).

I have seen people say that you should be putting the .gem files in ~/.shoes/+gem/gem (on OS X) but that hasn't worked for me. Neither has putting the source code for the gem there.

On another odd note, both the gems RedCloth and Nokogiri come with Shoes...but using the above code for them gets me No such file to load errors for both of them.

Anyone have any expertise in this area and can help me out?

Hey, Shoes maintainer here.

Gems with native extensions won't work. That said, mechanize should. However, sometimes, on OSX, the gem install dialog kinda hangs, and I haven't totally figured out why yet. This is probably what you're experiencing. :/

Secondly, Shoes does not come with Nokogiri, it comes with hpricot. We are planning on moving to nokogiri in a future release, though. It also does not come with RedCloth.