我是 Ruby 新手,对命令行也比较陌生。我正在尝试安装 Jekyll 来构建静态站点,但遇到了一些问题。我安装了 Ruby v. 1.8.7 和 Ruby Gems v. 1.8.25,但运行时出现此错误:
$ sudo gem install jekyll
我明白了:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/fast-stemmer-1.0.1/ext/gem_make.out
谁能告诉我如何安装 ruby 的头文件?我需要将它们安装在特定目录中吗?我是否需要在不同的目录中完全重新安装 Ruby,因为这是我的 Mac 附带的原始安装/设置?
更新
我已经安装了 XCode 并安装了 RVM,但我无法超越这一点。当我尝试安装 Ruby 时,我得到了这个:
Daniels-MacBook-Air:~ danielrosenthal$ rvm -v
rvm 1.18.3 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
Daniels-MacBook-Air:~ danielrosenthal$ rvm install 1.8.7
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.8.7-p371.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
Daniels-MacBook-Air:~ danielrosenthal$ rvm requirements
Requirements for osx/10.8/x86_64
NOTE: 'ruby' represents Matz's Ruby Interpreter (MRI) (1.8.X, 1.9.X)
This is the *original* / standard Ruby Language Interpreter
'ree' represents Ruby Enterprise Edition
'rbx' represents Rubinius
Additional Dependencies:
# For update-system:
Always update your system first!
# For rvm:
Install: bash curl git patch
# For ruby:
Install: osx-gcc-installer libksba openssl libreadline git zlib1g libyaml libsqlite3 sqlite3 libxml2 libxslt autoconf libc6 libgdbm ncurses automake libtool bison pkg-config
# For jruby:
Install: openjdk ant
有人可以帮我解决这个问题吗?提前致谢。