/usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/mkmf.rb:381:in `try_do':
The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
Run Code Online (Sandbox Code Playgroud)
我在CentOS 6.2服务器上使用RVM安装了ruby 1.9.3.当我尝试运行gem install nokogiri它时产生下面的输出.我已经访问了nokogiri网站并使用yum安装了libxml2和libxslt依赖项:
sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel
Run Code Online (Sandbox Code Playgroud)
我还安装了libxml2和libxslt软件包,rvm pkg install然后重新安装了ruby.
我一直在寻找解决方案,但我还没有找到任何东西.任何想法,将不胜感激 :)
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for libxml/parser.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack …Run Code Online (Sandbox Code Playgroud) 我有一个带有几个子模块的木偶模块.父模块有自己的事件聚合器,我想在子模块中使用它来触发事件.我知道我可以使用Application的事件聚合器,但这些事件特定于父模块及其子模块,而不是整个应用程序.
我可以命名应用程序的事件聚合器中的事件,如下所示:
App.module("Parent.Child", function(self, App, ...) {
// somewhere in the child
App.vent.trigger("Parent:something");
});
Run Code Online (Sandbox Code Playgroud)
但我真的不想走那条路.我认为为父模块及其子模块设置单个事件聚合器的想法更清晰.我喜欢从Parent到Application的单一界面,以及从Child到Parent的界面......但也许我在这个想法中错了?
我也可以从App对象获取Parent Module的事件聚合器,如下所示:
App.module("Parent.Child", function(self, App, ...) {
// somewhere in the child...
App.Parent.vent.trigger("something");
});
Run Code Online (Sandbox Code Playgroud)
但我也不愿意这样做.我认为这会将Child模块和App紧密结合在一起.
还有其他想法或选择吗?也许这些是好主意,我只是不明白其中的好处.