ruby - 在 FreeBSD 上安装 gosu

标签 ruby rubygems freebsd libgosu

我正在尝试在 FreeBSD 上安装这个 Ruby gem,但失败并出现以下错误:

# gem install gosu
Building native extensions. This could take a while...
ERROR:  Error installing gosu:
        ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
/usr/local/bin/ruby24 -I /usr/local/lib/ruby/site_ruby/2.4 -r ./siteconf20190322-6847-x8s25j.rb extconf.rb
The Gosu gem requires some libraries to be installed system-wide.
See the following site for a list:
https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux
cat: /proc/cpuinfo: No such file or directory
checking for -lopenal... yes
checking for AL/al.h... yes
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
In file included from ../../src/Audio.cpp:17:
../../src/SndFile.hpp:111:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
        : file(nullptr), reader(buffer.front_reader())
                                ^
../../src/SndFile.hpp:123:33: warning: field 'buffer' is uninitialized when used here [-Wuninitialized]
        : file(nullptr), reader(buffer.front_reader())
                                ^
2 warnings generated.
compiling ../../src/AudioImpl.cpp
compiling ../../src/Bitmap.cpp
compiling ../../src/BitmapIO.cpp
compiling ../../src/BlockAllocator.cpp
compiling ../../src/Channel.cpp
compiling ../../src/Color.cpp
compiling ../../src/DirectoriesApple.cpp
compiling ../../src/DirectoriesUnix.cpp
compiling ../../src/DirectoriesWin.cpp
compiling ../../src/FileUnix.cpp
../../src/FileUnix.cpp:53:47: error: use of undeclared identifier 'S_IRUSR'
    pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
                                              ^
../../src/FileUnix.cpp:53:55: error: use of undeclared identifier 'S_IWUSR'
    pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
                                                      ^
../../src/FileUnix.cpp:53:63: error: use of undeclared identifier 'S_IRGRP'
    pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
                                                              ^
../../src/FileUnix.cpp:53:71: error: use of undeclared identifier 'S_IWGRP'
    pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
                                                                      ^
../../src/FileUnix.cpp:53:79: error: use of undeclared identifier 'S_IROTH'
    pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
                                                                              ^
../../src/FileUnix.cpp:53:87: error: use of undeclared identifier 'S_IWOTH'
    pimpl->fd = open(filename.c_str(), flags, S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
                                                                                      ^
6 errors generated.
*** Error code 1

Stop.
make: stopped in /usr/local/lib/ruby/gems/2.4/gems/gosu-0.14.5/ext/gosu

我尝试过的其他事情:

  • 转换编译器 - 从 clang 和 c++ 到 g++ 和 gcc。
  • 克隆存储库并“手动”构建 - 出现相同的错误。

甚至可以在 FreeBSD 上安装它吗?搜索没有返回任何有用的信息。

最佳答案

在 FreeBSD 系统上,头文件的组织方式与在 Linux 中略有不同。

Quick man 查找显示,您需要

#include    <sys/types.h>
#include    <sys/stat.h>
#include    <fcntl.h>

使这些定义可见。

关于ruby - 在 FreeBSD 上安装 gosu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55307654/

相关文章:

ruby-on-rails - Ruby on Rails : Sending large pictures using send_data/send_file results in errors

ruby - 如何在我的 .zshrc 中包含一个文件?

ruby-on-rails - 启动 Rails 服务器时出现问题

node.js - Node v0.10.x (freebsd) "X509_STORE_add_cert:cert already in hash table"

ruby - 需要帮助将 Ruby 代码转换为 F#

ruby-on-rails - 获取错误缺少必需的 key : [:id] on a form_tag

ruby-on-rails - 如何读取包含双引号 (") 的 CSV

ruby - 从 jruby-complete 中消耗 gem

sockets - 为什么 connect() 会间歇性地在 FreeBSD 端口上给出 EINVAL?

c++ - 为什么malloc不能在FreeBSD-x64内核空间分配大内存?