出现此错误
ERROR: Error installing dnssd:
ERROR: Failed to build gem native extension.
/Users/me/.rvm/rubies/ruby-1.9.3-p550/bin/ruby -r ./siteconf20141108-39945-13la3bu.rb extconf.rb
checking for dns_sd.h... no
unable to find dnssd header
*** extconf.rb failed ***
Gem files will remain installed in /Users/me/.rvm/gems/ruby-1.9.3-p550@kevy/gems/dnssd-2.0 for inspection.
Results logged to /Users/me/.rvm/gems/ruby-1.9.3-p550@kevy/extensions/x86_64-darwin-14/1.9.1/dnssd-2.0/gem_make.out
An error occurred while installing dnssd (2.0), and Bundler cannot continue.
Make sure that `gem install dnssd -v '2.0'` succeeds before bundling.
我正在运行 yosemite osx,因此默认情况下头文件就在那里。我在 /usr/include/dns_sd.h 找到了它。
除了重装操作系统还有什么办法解决吗?
谢谢
在我的ubuntu系统上,我也遇到这个问题。
eric@Ideapad:~$ gem install ahoy
Fetching ahoy-0.1.4.gem
Fetching xmpp4r-0.5.gem
Fetching dnssd-3.0.2.gem
Successfully installed xmpp4r-0.5
Building native extensions. This could take a while...
ERROR: Error installing ahoy:
ERROR: Failed to build gem native extension.
current directory: /home/eric/.rvm/gems/ruby-3.3.0/gems/dnssd-3.0.2/ext/dnssd
/home/eric/.rvm/rubies/ruby-3.3.0/bin/ruby extconf.rb
checking for dns_sd.h... no
unable to find dnssd header
*** 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.
然后我安装 libavahi-compat-libdnssd-dev,如下所示:
sudo apt install libavahi-compat-libdnssd-dev
完成此步骤后,您就可以
eric@Ideapad:~$ gem install ahoy
Building native extensions. This could take a while...
Successfully installed dnssd-3.0.2
Successfully installed ahoy-0.1.4
Parsing documentation for dnssd-3.0.2
Installing ri documentation for dnssd-3.0.2
Parsing documentation for ahoy-0.1.4
Installing ri documentation for ahoy-0.1.4
Done installing documentation for dnssd, ahoy after 0 seconds
2 gems installed