Gosu在Cloud9上的宝石?

时间:2018-10-25 22:31:26

标签: ruby game-development

我正在遵循“学习使用Ruby进行游戏编程”教程,并且难以设置工作空间。我在Windows计算机上使用AWS的cloud9 IDE。我已按照linux安装说明进行操作...

安装Linuxbrew

$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"

然后我将以下内容复制并粘贴到命令行中(一次粘贴一次)

$ test -d ~/.linuxbrew && PATH="$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin:$PATH"
$ test -d /home/linuxbrew/.linuxbrew && PATH="/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:$PATH"
$ test -r ~/.bash_profile && echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.bash_profile
$ echo "export PATH='$(brew --prefix)/bin:$(brew --prefix)/sbin'":'"$PATH"' >>~/.profile

然后使用

检查它是否正确安装
$ brew doctor

我安装了必需的库

$ brew install sdl2 libogg libvorbis

然后尝试安装Gosu gem

$ gem install gosu

但出现以下错误

Ignoring chipmunk-6.1.3.4 because its extensions are not built. Try: gem pristine chipmunk --version 6.1.3.4
Ignoring executable-hooks-1.3.2 because its extensions are not built. Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Error loading RubyGems plugin "/usr/local/rvm/gems/ruby-2.3.4@global/gems/executable-hooks-1.3.2/lib/rubygems_plugin.rb": cannot load such file -- executable-hooks/wrapper (LoadError)
Error loading RubyGems plugin "/usr/local/rvm/gems/ruby-2.3.4@global/gems/gem-wrappers-1.2.7/lib/rubygems_plugin.rb": cannot load such file -- gem-wrappers (LoadError)
Building native extensions. This could take a while...
ERROR:  Error installing gosu:
        ERROR: Failed to build gem native extension.

    current directory: /usr/local/rvm/gems/ruby-2.3.4/gems/gosu-0.14.4/ext/gosu
/home/linuxbrew/.linuxbrew/opt/ruby/bin/ruby -r ./siteconf20181025-72661-5io7wt.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
checking for -lopenal... no
creating Makefile

current directory: /usr/local/rvm/gems/ruby-2.3.4/gems/gosu-0.14.4/ext/gosu
make "DESTDIR=" clean

current directory: /usr/local/rvm/gems/ruby-2.3.4/gems/gosu-0.14.4/ext/gosu
make "DESTDIR="
compiling ../../src/Audio.cpp
cc1plus: warning: command line option '-Wimplicit-int' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wdeclaration-after-statement' is valid for C/ObjC but not for C++
cc1plus: warning: command line option '-Wimplicit-function-declaration' is valid for C/ObjC but not for C++
In file included from ../../src/Audio.cpp:1:0:
../../src/AudioImpl.hpp:9:19: fatal error: AL/al.h: No such file or directory
compilation terminated.
make: *** [Audio.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.3.4/gems/gosu-0.14.4 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.3.4/extensions/x86_64-linux/2.5.0/gosu-0.14.4/gem_make.out

我已确保我使用的是Homebrew / linuxbrew而非rvm的ruby安装版本

$ brew unlink ruby && brew link ruby

我也尝试过

$ gem install gosu --platform=ruby

该错误提及“请参见以下站点的列表: 我尝试遵循的https://github.com/gosu/gosu/wiki/Getting-Started-on-Linux'在尝试安装这些库时出现以下错误。

$ sudo apt-get install build-essential libsdl2-dev libsdl2-ttf-dev libpango1.0-dev \ libgl1-mesa-dev libopenal-dev libsndfile-dev libmpg123-dev \ libgmp-dev

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libsdl2-dev
E: Unable to locate package libsdl2-ttf-dev
E: Unable to locate package  libgl1-mesa-dev
E: Unable to locate package libopenal-dev
E: Unable to locate package libsndfile-dev
E: Unable to locate package libmpg123-dev
E: Unable to locate package  libgmp-dev

我相信sdl2,libogg和libvorbis已取代了上述库

我不知道如何将Gosu gem放入cloud9

0 个答案:

没有答案