ruby-on-rails - Ruby on Rails : cannot install FFI 1. 1.5 和捆绑程序无法继续

标签 ruby-on-rails linux x86-64

我正在关注 the rails tutorial 上的教程现在正在第三章(静态页面)。当我尝试立即执行 list 3.1 下的bundle install 时,该命令会抛出一条错误消息,指示链接失败。错误的片段如下所示:

Using bundler (1.2.1)
Using nokogiri (1.5.5)
Installing ffi (1.1.5) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/bin/ruby18 extconf.rb  
checking for ffi_call() in -lffi... yes checking for ffi_prep_closure()... yes 
checking for ffi_raw_call()... yes 
checking for ffi_prep_raw_closure()... yes 
checking for rb_thread_blocking_region()... no 
checking for ruby_native_thread_p()... no 
checking for rb_thread_call_with_gvl()... no creating extconf.h 
creating Makefile
... 
... 
... 
x86_64-pc-linux-gnu-gcc -I. -I. -I/usr/lib64/ruby/1.8/x86_64-linux -I. -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -O2 -pipe -fno-strict-aliasing  -fPIC  -I/usr/lib64/libffi-3.0.10/include    -c LastError.c x86_64-pc-linux-gnu-gcc -shared -o ffi_c.so FunctionInfo.o MemoryPointer.o MethodHandle.o Platform.o Function.o LongDouble.o StructLayout.o StructByValue.o Struct.o Variadic.o ClosurePool.o Type.o Types.o ArrayType.o DynamicLibrary.o Thread.o Call.o Buffer.o StructByReference.o AbstractMemory.o ffi.o MappedType.o Pointer.o DataConverter.o LastError.o -L. -L/usr/lib64 -Wl,-R/usr/lib64 -L.-Wl,-O1 -Wl,--as-needed -rdynamic -Wl,-export-dynamic -Wl,--no-undefined     -Wl,-R -Wl,/usr/lib64 -L/usr/lib64 -lruby18 -lffi  -lffi   -lrt -ldl -lcrypt -lm   -lc 
Thread.o: In function `rbffi_thread_blocking_region': 
Thread.c:(.text+0xd0): undefined reference to `pthread_create' 
Thread.c:(.text+0x106): undefined reference to `pthread_join' 
Thread.o: In function `cleanup_blocking_thread': Thread.c:(.text+0x239): undefined reference to `pthread_kill'
Thread.o: In function `rbffi_blocking_thread': Thread.c:(.text+0x271): undefined reference to `pthread_testcancel' collect2: ld returned 1 exit status make: *** [ffi_c.so] Error 1


Gem files will remain installed in /home/user/.gem/gems/ffi-1.1.5 for inspection. 
Results logged to /home/user/.gem/gems/ffi-1.1.5/ext/ffi_c/gem_make.out 
An error occurred while installing ffi (1.1.5), and Bundler cannot continue. 
Make sure that `gem install ffi -v '1.1.5'` succeeds before bundling.

据我所知,通过添加正确的 pthread 库(-lpthread)可以轻松解决这个问题。但我的问题是,我该在哪里添加这个?我看到很多在 MAC OS X 上解决这个问题的问题,但没有一个是针对 Linux 的。任何帮助表示赞赏。

最佳答案

将“dev-lang/ruby 线程”添加到我的 package.use 并重建 dev-lang/ruby

关于ruby-on-rails - Ruby on Rails : cannot install FFI 1. 1.5 和捆绑程序无法继续,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13183282/

相关文章:

ruby-on-rails - rails : How to make available parent attribute in setter method

c++ - 安装 kumofs 时出错

linux - 核心转储文件名被截断

c++ - 在 gcc linux x86-64 C++ 中,(p+x)-x 是否总是为指针 p 和整数 x 生成 p

c++ - 多线程和内存

ruby-on-rails - Ruby on Rails 的持续集成?

ruby-on-rails - 从 Rails URL 路由中删除 Controller 名称

当我通过 USB 集线器连接串行设备时,Linux 进程进入 D 状态

assembly - packuswb 指令是如何工作的? (在低电平位操作)

javascript - 输入[type ='file' ] 标签名称