2017-04-17 107 views
0

我正在按照步骤说明Ember Guides关于本地配置项目的说明。'bundle exec middleman'命令在Mac OS Sierra上失败

我开始安装每个软件包管理器(Homebrew,Bundler)和builder(Middleman)。

但执行项目(捆绑EXEC中间人)的时候,我得到一个错误,服务器无法启动:

MacBook-Pro-de-Pedro:guides pedro$ bundle exec middleman 
bundler: failed to load command: middleman (/usr/local/bin/middleman) 
LoadError: Could not open library 'c': dlopen(c, 5): image not found. 
Could not open library 'libc.dylib': dlopen(libc.dylib, 5): image not found 
/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/lib/ffi/library.rb:133:in `block in ffi_lib' 
/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `map' 
/Library/Ruby/Gems/2.0.0/gems/ffi-1.9.10/lib/ffi/library.rb:100:in `ffi_lib' 
/Library/Ruby/Gems/2.0.0/gems/ethon-0.8.0/lib/ethon/libc.rb:8:in `<module:Libc>' 
/Library/Ruby/Gems/2.0.0/gems/ethon-0.8.0/lib/ethon/libc.rb:6:in `<module:Ethon>' 
/Library/Ruby/Gems/2.0.0/gems/ethon-0.8.0/lib/ethon/libc.rb:1:in `<top (required)>' 
/Library/Ruby/Gems/2.0.0/gems/ethon-0.8.0/lib/ethon.rb:10:in `require' 
/Library/Ruby/Gems/2.0.0/gems/ethon-0.8.0/lib/ethon.rb:10:in `<top (required)>' 
/Library/Ruby/Gems/2.0.0/gems/typhoeus-0.8.0/lib/typhoeus.rb:2:in `require' 
/Library/Ruby/Gems/2.0.0/gems/typhoeus-0.8.0/lib/typhoeus.rb:2:in `<top (required)>' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer/url_validator.rb:1:in `require' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer/url_validator.rb:1:in `<top (required)>' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer.rb:4:in `require' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer.rb:4:in `block in require_all' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer.rb:3:in `each' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer.rb:3:in `require_all' 
/Library/Ruby/Gems/2.0.0/gems/html-proofer-2.5.2/lib/html/proofer.rb:8:in `<top (required)>' 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:105:in `require' 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:105:in `rescue in block in require' 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:82:in `block in require' 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each' 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require' 
/Library/Ruby/Gems/2.0.0/gems/bundler-1.14.6/lib/bundler.rb:107:in `require' 
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.4.0/lib/middleman-core/load_paths.rb:37:in `setup_load_paths' 
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.4.0/bin/middleman:10:in `<top (required)>' 
/usr/local/bin/middleman:23:in `load' 
/usr/local/bin/middleman:23:in `<top (required)>' 

任何有同样的问题?

+1

尝试在已安装的文件中编辑'lib/ffi/library.rb'。用'LIBC ='/ usr/lib/libc.dylib''替换'LIBC = FFI :: Platform :: LIBC'字符串。有充分的讨论:https://github.com/ffi/ffi/issues/461 –

+1

非常感谢!它向我显示了路。只是更换这条线没有为我做。我陷入了另一个错误(找不到libcurl.dylib)。所以我遵循了那条说要下载'elcapt'分支的建议。我从那里得到了library.rb文件,并在我的本地Ruby安装中替换了它。可能不是最优雅的方式来解决它,但它为我做了:)。再次感谢 – ElPiter

回答

0

解决!正如Yevgeniy Anfilofyev在评论中所说,有充分的讨论here

之后,我最终做的是取代library.rb file content from the elcapt branch in the ffi/ffi project

这可能不是最优雅的方法来解决它,但它为我做了。

其他开发者做了什么Yevgeniy在他的评论中提到,这就够了。只需替换该文件中的变量值:将LIBC = FFI :: Platform :: LIBC字符串替换为LIBC ='/usr/lib/libc.dylib'。