sudo gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/Users/sajeev86/.rvm/rubies/ruby-1.8.7-p352/bin/ruby extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Run Code Online (Sandbox Code Playgroud)
我无法安装Nokogiri.这对我来说已经有一段时间了.我也通过MacPorts和Homebrew安装了依赖项.
我有一种感觉,正确的目录没有彼此指向?但不知道如何解决.
我希望这是我做过的傻事.我在底部附近有一个函数unigref,我相信它会输出一个字符串.但是,当我调用该函数来构建一个jQuery选择器时,我无法让它正常工作.我知道其他一切都有效,因为当我使用静态字符串时,单选按钮被选中.
这是我的jsfiddle/9Edxx.请帮忙.
var checkCount = 0;
var maxChecks = 2;
$(document).ready(function() {
$("#test").click(function() {
alert($(':checked').length);
});
$(':checkbox[name=checkbox]').change(function() {
checkCount = $(':checkbox:checked').length;
if (checkCount >= maxChecks) {
$(':checkbox[name=checkbox]').not(':checked').attr('disabled', true);
$(":radio[value="+uniqref()+"]").prop('checked', true);
} else {
$(':checkbox[name=checkbox]:disabled').attr('disabled', false);
}
if (this.checked) {
$("td.label").append("<label>" + this.value + "</label>");
} else {
$("td.label").find(":contains('" + this.value + "')").remove();
}
});
$('#button').click(function() {
alert(uniqref());
});
function uniqref() {
return $("td.label").text().split('').sort().join('').replace(/\s/g, "");
}
});?
Run Code Online (Sandbox Code Playgroud)
更新:错字是正确的,但问题仍然存在.