【问题标题】:unable to install Gosu library in Ruby in Linux无法在 Linux 中的 Ruby 中安装 Gosu 库
【发布时间】:2015-04-12 13:27:41
【问题描述】:

当我尝试在 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 安装这些软件包,但无法安装它们,因为它说在任何来源都找不到这些软件包。

【问题讨论】:

    标签: ruby linux ruby-2.1 libgosu


    【解决方案1】:

    你确定所有的依赖都安装正确了吗?

    首先请检查它们:

    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
    

    移动到文件末尾并检查为什么让脚本停止!在这里发布错误,然后我可以帮助您解决问题!

    【讨论】:

    • 感谢您提供信息,但脚本不能停在那里。请更新完整的日志或日志文件的结尾,不要开始,你必须在日志文件的最后一行看到错误或致命错误
    • 还有关于缺少的 deps,关于 libsdl,只有两个包可用于您的 ubuntu 版本,您可以使用以下命令安装它们:apt-get install libsdl-ttf2.0-0 libsdl-ttf-gst 和另外两个缺少的包,可以用这个命令安装:apt-get install libopenal-dev libsndfile1-dev
    • 如果你在其中一个命令上失败了,首先使用 apt-cache search packagename,然后再试一次。
    猜你喜欢
    • 1970-01-01
    • 2022-09-26
    • 2011-07-12
    • 1970-01-01
    • 1970-01-01
    • 2018-03-17
    • 1970-01-01
    • 1970-01-01
    • 2016-10-28
    相关资源
    最近更新 更多