- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我是 ruby 和命令行的新手。
Ruby -v:ruby 2.3.7p456(2018-03-28 修订版 63024)[universal.x86_64-darwin18]
Mac: Mojave 10.14.2
我正在尝试在我的本地主机上打开我的 Jekyll 博客,这在之前并没有给我带来问题。然而我跑了
bundle exec jekyll serve
并得到这个错误:
Could not find eventmachine-1.2.7 in any of the sources
Run `bundle install` to install missing gems.
按照建议,我然后运行
bundle install
并得到这个错误:
Ignoring ffi-1.9.25 because its extensions are not built. Try: gem pristine ffi --version 1.9.25
Ignoring http_parser.rb-0.6.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.6.0
Fetching gem metadata from https://rubygems.org/...........
Using rake 10.5.0
Using public_suffix 3.0.3
Using addressable 2.5.2
Using bundler 2.0.1
Using colorator 1.1.0
Using concurrent-ruby 1.0.5
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/name/Desktop/GitHub/blog/vendor/bundle/ruby/2.3.0/gems/eventmachine-1.2.7/ext
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20190212-57509-l19d0i.rb extconf.rb
--with-cppflags=-I/usr/local/opt/openssl/include
checking for main() in -lcrypto... *** 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
--with-ssl-dir
--without-ssl-dir
--with-ssl-include
--without-ssl-include=${ssl-dir}/include
--with-ssl-lib
--without-ssl-lib=${ssl-dir}/lib
--with-openssl-config
--without-openssl-config
--with-pkg-config
--without-pkg-config
--with-cryptolib
--without-cryptolib
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to
generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:535:in `block in try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/tmpdir.rb:89:in `mktmpdir'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:532:in `try_link0'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:556:in `try_link'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:765:in `try_func'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:320:in `open'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:346:in `postpone'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:941:in `checking_for'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:992:in `have_library'
from extconf.rb:8:in `block in check_libs'
from extconf.rb:8:in `each'
from extconf.rb:8:in `all?'
from extconf.rb:8:in `check_libs'
from extconf.rb:95:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/name/Desktop/GitHub/blog/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/eventmachine-1.2.7/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/Users/nbame/Desktop/GitHub/blog/vendor/bundle/ruby/2.3.0/gems/eventmachine-1.2.7 for inspection.
Results logged to
/Users/name/Desktop/GitHub/blog/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/eventmachine-1.2.7/gem_make.out
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
jekyll was resolved to 3.8.3, which depends on
em-websocket was resolved to 0.5.1, which depends on
eventmachine
我试过:
使用 gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/ ' 提示“错误:构建 gem native 扩展失败。”
按照推荐的 here brew install coreutils
this question 的每一个答案
关于 Mojave 和 gem 更新失败的 here 答案
gem pristine ffi --version 1.9.25 因为它在错误消息中这样建议
我的mkmf.log日志如下
"xcrun clang -o conftest -I/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin18 -I/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/backward -I/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I. -I/usr/local/opt/openssl/include -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib -L. -lruby.2.3.0 -lpthread -ldl -lobjc "
In file included from conftest.c:1:
In file included from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
^~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
"pkg-config --exists openssl"
package configuration for openssl is not found
最佳答案
我很幸运地用 Homebrew 安装了 libffi
,然后使用推荐的构建标志:
$ brew install libffi
==> Downloading https://homebrew.bintray.com/bottles/libffi-3.2.1.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libffi-3.2.1.mojave.bottle.tar.gz
==> Caveats
libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.
For compilers to find libffi you may need to set:
export LDFLAGS="-L/usr/local/opt/libffi/lib"
For pkg-config to find libffi you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
$ LDFLAGS="-L/usr/local/opt/libffi/lib" PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" bundle install
我有很多使用 FFI 的项目,但我没有导出这些变量(因为它们是全局变量),而是在我的 Bash 配置文件中添加了一个别名,这样我就可以轻松地即时设置它们:
# ~/.bash_profile
alias ffi='LDFLAGS="-L/usr/local/opt/libffi/lib" PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"'
现在每当我有一个使用 FFI 的项目时,我都可以像这样安装 gem:
$ ffi bundle install
关于ruby - 在 macOS Mojave 上安装 eventmachine 时如何修复 "ERROR: Failed to build gem native extension.",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54656946/
我的控制台上出现以下错误 root@comp09:~# gem install eventmachine Building native extensions. This could take a
我在 JRuby 中安装了 EventMachine(我使用的是 Win32)。当我尝试服务器示例时,出现错误 require 'eventmachine' 错误是: C:\dev\em>jruby
我有一些 Deferrables,当它们全部完成时我需要在回调中做一些事情。 defers[0].callback do defers[1].callback do defer
我正在编写一个应用程序,它使用 EventMachine 来中继来自服务的命令。我想重新使用与服务的连接(而不是为每个新请求重新创建它)。该服务从模块方法启动,并且该模块提供给 EventMachin
更新: 我找到了简单的答案,这完全是我自己的错:我将上面的代码存储在一个名为“eventmachine.rb”的文件中。因此,当我需要“eventmachine”时,它只是导入了相同的文件,其中不包含
好的,我有代码在后台使用 Cramp\Tramp => EventMachine。代码: class RetrieveController 0.12' gem 'tramp', '~> 0.2' g
每个人总是明确提到 next_tick 将在主线程中执行。但是定时器和回调/错误反馈呢?它们是否也保证在主线程中运行? 最佳答案 无论 Ruby 版本如何,EM 在 react 器线程内运行除 EM.
在 ruby 1.9.2-p290 上编译 eventmachine 0.12.10 时出现以下错误输出: g++ -shared -o rubyeventmachine.so binder.o cm
我收到以下错误: eventmachine.rb:534:in `start_tcp_server': no acceptor (port is in use or requires root pri
我有一个使用 eventmachine 编写的小型 HTTP 服务器脚本,它需要调用外部脚本/命令并通过反引号 (``) 调用。当提供不运行反引号代码的请求时,一切都很好,但是,一旦我的 EM 代码执
我写了一个像这样的简单的 EventMachine 服务器: EventMachine.run do EventMachine::WebSocket.start(:host => HOST, :p
“run” block 是否在 EM 中作为一个整体执行(没有上下文切换)?在此示例中,if 子句中是否存在竞争条件? EventMachine.run { @current_value = 0
获取端口已在使用错误。 require 'em-websocket' EM.run { EM::WebSocket.run(:host => "192.168.1.100", :port =>
我对一般编程还很陌生,我在客户端和服务器端都使用 EventMachine 来打开它们之间的 websocket 连接。 我的问题出在客户端,以及由于网络连接问题导致连接丢失时。 def websoc
如何终止 EventMachine 中正在运行的进程?下面是一个示例,我正在启动 10 个进程,然后我试图将它们全部删除(但它不起作用)。我的目标是不要有“完成”输出。 require "rubyge
我使用 EventMachine LineText2 协议(protocol),我想在每次按下键盘上的字符时触发 receive_line 方法,而不仅仅是在输入新行时触发。有没有办法改变这种默认行为
这是我的代码: EventMachine.run { conn = EM::Protocols::HttpClient2.connect request.host, 80 req =
我正在研究使用 EventMachine 支持的 twitter-stream rubygem 来跟踪和捕获推文。我对整个事件编程有点陌生。我如何判断我在事件循环中所做的任何处理是否导致我落后?有
我的第一个问题是关于 Ruby 的。我正在尝试测试 Reactor 循环内的 EventMachine 交互 - 我想它可以归类为“功能”测试。 假设我有两个类 - 服务器和客户端。我想测试双方 -
我正在使用合适的 Redis EM gem(在我的例子中为“em-hiredis”)读取 EventMachine react 器循环中的 Redis 集,并且必须检查某些 Redis 集是否包含级联
我是一名优秀的程序员,十分优秀!