我的系统
- 操作系统:openSUSE Leap 42.1
- 内核:x86_64 Linux 3.16.7-29-desktop
- 外壳:zsh 5.0.5
- CPU:英特尔酷睿 i7-3610QM CPU @ 3.3GHz
gem -v
:2.2.2
我正在尝试做什么
我正在尝试安装 Nesta CMS,但其中一个运行时依赖项安装失败:折扣。
以 root 身份正常输出:
% gem install rdiscount ~ linux-7o7a
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
/usr/bin/ruby.ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib64/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /usr/lib64/ruby/gems/2.1.0/gems/rdiscount-2.1.8 for inspection.
Results logged to /usr/lib64/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/rdiscount-2.1.8/gem_make.out
以 root 身份调试输出(相当长): 调试链接
答案1
我需要安装 ruby developer 包ruby-devel
:
% zypper install ruby-devel ~ linux-7o7a
Loading repository data...
Reading installed packages...
Resolving package dependencies...
The following 2 NEW packages are going to be installed:
ruby-devel ruby2.1-devel
2 new packages to install.
Overall download size: 3.1 MiB. Already cached: 0 B. After the operation, additional 20.1 MiB will be used.
Continue? [y/n/? shows all options] (y): y
Retrieving package ruby2.1-devel-2.1.2-5.7.x86_64 (1/2), 3.1 MiB ( 20.1 MiB unpacked)
Retrieving: ruby2.1-devel-2.1.2-5.7.x86_64.rpm ...........................................................................................................................................................................[done (595.5 KiB/s)]
Retrieving package ruby-devel-2.1-3.2.x86_64 (2/2), 10.5 KiB ( 84 B unpacked)
Retrieving: ruby-devel-2.1-3.2.x86_64.rpm ..............................................................................................................................................................................................[done]
Checking for file conflicts: ...........................................................................................................................................................................................................[done]
(1/2) Installing: ruby2.1-devel-2.1.2-5.7 ..............................................................................................................................................................................................[done]
(2/2) Installing: ruby-devel-2.1-3.2 ...................................................................................................................................................................................................[done]
之后,rdiscount
安装好:
% gem install rdiscount ~ linux-7o7a
Building native extensions. This could take a while...
Successfully installed rdiscount-2.1.8
Parsing documentation for rdiscount-2.1.8
Installing ri documentation for rdiscount-2.1.8
Done installing documentation for rdiscount after 0 seconds
1 gem installed