对于ruby虚拟环境,我应该指向哪个$ PATH目录?

时间:2019-06-13 09:31:52

标签: ruby jekyll

现在,我正在尝试通过cPanel在共享主机服务上安装jekyll,但遇到了麻烦。我从运行中获得的输出

gem install jekyll

我得到的输出是

Fetching ffi-1.11.1.gem
Fetching rb-fsevent-0.10.3.gem
Fetching jekyll-watch-2.2.1.gem
Fetching listen-3.1.5.gem
Fetching sass-listen-4.0.0.gem
Fetching sass-3.7.4.gem
Fetching rb-inotify-0.10.0.gem
Fetching jekyll-sass-converter-1.5.2.gem
Fetching concurrent-ruby-1.1.5.gem
Fetching i18n-0.9.5.gem
Fetching http_parser.rb-0.6.0.gem
Fetching eventmachine-1.2.7.gem
Fetching em-websocket-0.5.1.gem
Fetching colorator-1.1.0.gem
Fetching public_suffix-3.1.0.gem
Fetching addressable-2.6.0.gem
Fetching jekyll-3.8.5.gem
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.

   current directory: /home/daebsujk/rubyvenv/bigtest/2.6/gems/ffi-1.11.1/ext/ffi_c
/opt/alt/ruby26/bin/ruby -I /opt/alt/ruby26/lib64/ruby/2.6.0 -r ./siteconf20190613-717032-gcg4kd.rb extconf.rb
checking for ffi.h...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.

Provided configuration options:
  --with-opt-dir
  --without-opt-dir
  --with-opt-include
  --without-opt-include=${opt-dir}/include
  --with-opt-lib
  --without-opt-lib=${opt-dir}/lib64
  --with-make-prog
  --without-make-prog
  --srcdir=.
  --curdir
  --ruby=/opt/alt/ruby26/bin/$(RUBY_BASE_NAME)
  --with-ffi_c-dir
  --without-ffi_c-dir
  --with-ffi_c-include
  --without-ffi_c-include=${ffi_c-dir}/include
  --with-ffi_c-lib
  --without-ffi_c-lib=${ffi_c-dir}/lib64
  --enable-system-libffi
  --disable-system-libffi
  --with-libffi-config
  --without-libffi-config
  --with-pkg-config
  --without-pkg-config
/opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:601:in `try_cpp'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:331:in `open'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:331:in `open'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:357:in `postpone'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:958:in `checking_for'
  from /opt/alt/ruby26/lib64/ruby/2.6.0/mkmf.rb:1108:in `have_header'
  from extconf.rb:10:in `system_libffi_usable?'
  from extconf.rb:34:in `<main>'

To see why this extension failed to compile, please check the mkmf.log
which can be found here:

/home/daebsujk/rubyvenv/bigtest/2.6/extensions/x86_64-linux/2.6.0/ffi-1.11.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in
/home/daebsujk/rubyvenv/bigtest/2.6/gems/ffi-1.11.1 for inspection.
Results logged to
/home/daebsujk/rubyvenv/bigtest/2.6/extensions/x86_64-linux/2.6.0/ffi-1.11.1/gem_make.out

使用the digital ocean tutorial在数字海洋小滴上安装jekyll非常容易,但我不熟悉cPanel和ruby虚拟环境。

我认为我的问题是我需要$PATH目录用于虚拟环境才能正确运行gem命令。

0 个答案:

没有答案