操作系统:Ubuntu 18.04 GCC版本:gcc版本7.4.0(Ubuntu 7.4.0-1ubuntu1~18.04.1) JRuby 版本:9.2.8.0 红宝石版本:2.5.3
问题来源:尝试安装pronto
gem(版本 0.11.0)
运行gem install pronto
时,gem 安装在依赖rugged
gem 尝试构建本机扩展时失败,并出现以下错误:
-- Build files have been written to: /home/ubuntu/.rvm/gems/jruby-9.2.8.0/gems/rugged-1.0.1/vendor/libgit2/build
-- /usr/bin/make
checking for main() in -lgit2... RuntimeError: The compiler failed to generate an executable file.
You have to install development tools first.
try_do at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:456
try_link0 at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:541
try_link at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:556
try_func at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:765
have_library at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:997
checking_for at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:942
postpone at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:350
open at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:320
postpone at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:350
open at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:320
postpone at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:346
checking_for at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:941
have_library at /home/ubuntu/.rvm/rubies/jruby-9.2.8.0/lib/ruby/stdlib/mkmf.rb:992
<main> at extconf.rb:137
*** 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}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/ubuntu/.rvm/rubies/jruby-9.2.8.0/bin/jruby
--with-sha1dc
--without-sha1dc
--use-system-libraries
--with-git2-dir
--without-git2-dir
--with-git2-include
--without-git2-include=${git2-dir}/include
--with-git2-lib
--without-git2-lib=${git2-dir}/lib
--with-git2lib
--without-git2lib
我尝试了以下不同的方法来使其正常工作,但所有方法都失败并出现相同的错误:
- 独立运行
gem install rugged
。 - 克隆
rugged
git 存储库并手动构建代码。 - 手动构建
libgit2
然后构建rugged
存储库。
请让我知道是否存在解决此问题的方法,或者是否有其他方法可以处理以下 pronto 命令:
PRONTO_GITHUB_ACCESS_TOKEN=<access_token> pronto run -c origin/master -f github_pr_review
我最初的问题是我想使用 CI 在我的拉取请求上运行 rubocop 版本 1.17。rubocop 应该只在拉取请求中出现的更改的 ruby 代码行上运行,而不是在整个文件上运行它。