当我尝试在Ubuntu 13.10上安装gosu时,我收到此错误
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using diff-lcs 1.2.5
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux
checking for TTF_RenderUTF8_Blended() in -lSDL2_ttf... yes
checking for SDL_ttf.h... yes
checking for FreeImage_ConvertFromRawBits() in -lfreeimage... yes
checking for FreeImage.h... yes
checking for main() in -lopenal... no
creating Makefile
make
compiling gosu_wrap.cxx
In file included from /usr/include/ruby-1.9.1/ruby.h:32:0,
from gosu_wrap.cxx:850:
gosu_wrap.cxx: In function ‘void Gosu::loadBitmap(Gosu::Bitmap&, VALUE)’:
/usr/include/ruby-1.9.1/ruby/ruby.h:675:31: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
RSTRING(str)->as.heap.len)
^
我尝试添加https://github.com/jlnr/gosu/wiki/Getting-Started-on-Linux中的每个库,但我仍然遇到上述错误。有人可以帮我这个吗?
被修改: 当我检查已安装软件包的状态为
时 dpkg -s gcc libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev | grep Status
我获得以下状态:
Status: install ok installed
dpkg-query: package 'libsdl2-ttf-dev' is not installed and no information is available
Status: install ok installed
Status: install ok installed
Status: install ok installed
dpkg-query: package 'libopenal-dev' is not installed and no information is available
Status: install ok installed
dpkg-query: package 'libsndfile-dev' is not installed and no information is available
Use dpkg --info (= dpkg-deb --info) to examine archive files,
and dpkg --contents (= dpkg-deb --contents) to list their contents.
因此,未安装libsdl2-ttf-dev和libsndfile-dev。我尝试使用apt-get install
安装这些软件包,但由于无法在任何来源中找到软件包,因此无法安装它们。
答案 0 :(得分:2)
您确定所有依赖项都已正确安装吗?
首先请检查一下:
dpkg -s gcc libsdl2-dev libsdl2-ttf-dev libpango1.0-dev libgl1-mesa-dev libfreeimage-dev libopenal-dev libsndfile-dev | grep Status
然后,您可以轻松检查问题!你必须检查安装日志文件:
你可以用编辑器打开文件,如vi,nano或cat,tail ......,我用过nano
nano /var/lib/gems/*/gems/*/ext/gosu/gem_make.out
移到文件末尾并检查脚本停止的原因!发布错误在这里,然后我可以帮助您解决问题!