2

我尝试在我的新虚拟机上安装qtbindings gem。我按照 gem page 上的说明做了所有事情,但是出了点问题。我有安装错误:

vagrant@machine:~$ sudo gem install qtbindings
Building native extensions.  This could take a while...
ERROR:  Error installing qtbindings:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb

make
mkdir ext/build
mkdir bin/1.9
mkdir bin/plugins
mkdir bin/plugins/accessible
mkdir bin/plugins/bearer
mkdir bin/plugins/codecs
mkdir bin/plugins/designer
mkdir bin/plugins/graphicssystems
mkdir bin/plugins/iconengines
mkdir bin/plugins/imageformats
mkdir bin/plugins/phonon_backend
mkdir bin/plugins/qmltooling
mkdir bin/plugins/sqldrivers
mkdir lib/1.9
cd ext/build; rm -rf CMakeFiles
cd ext/build; rm -rf generator
cd ext/build; rm -rf smoke
cd ext/build; rm -rf ruby
cd ext/build; rm *
rm: cannot remove '*': No such file or directory
make: [clean] Error 1 (ignored)
cd ext/build; \
cmake -DCMAKE_MINIMUM_REQUIRED_VERSION=2.6 \
-G "Unix Makefiles" \
-Wno-dev \
-DRUBY_EXECUTABLE=/usr/bin/ruby1.9.1 \
..
/bin/sh: 2: cmake: not found
make: [build] Error 127 (ignored)
cd ext/build; make
make[1]: Entering directory `/var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3/ext/build'
make[1]: *** No targets specified and no makefile found.  Stop.
make[1]: Leaving directory `/var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3/ext/build'
make: *** [build] Error 2

Gem files will remain installed in /var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/qtbindings-4.8.6.3/./gem_make.out          

操作系统乌布努 16.04。我做错了什么?

解决了

安装 cmake 和 qt-sdk

谢谢ajinkya-pisal

4

1 回答 1

0

值得注意的是,如果您通过 RVM 使用多个 Ruby 版本,则需要确保您已安装并选择了 2.2.6。要检查您安装了哪些版本,请运行

rvm list

如果您没有安装 Ruby 2.2.6,则需要通过运行安装它

rvm install 2.2.6

要选择 2.2.6,请运行

rvm use 2.2.6

如果是新安装,您还需要将 2.2.6 gem 添加到您的 PATH 中。通过运行来做到这一点

rvm get stable --auto-dotfiles
于 2021-01-14T07:54:19.657 回答