无法在Ubuntu 19.04上安装Ruby gem selenium-webdriver

时间:2019-06-12 16:22:41

标签: ruby linux selenium-webdriver rubygems

我正在尝试在Ubuntu 19.04上安装gem selenium-webdriver,但我一直收到此错误:

sudo gem install selenium-webdriver  
  

构建本机扩展。这个   可能需要一段时间...错误:安装selenium-webdriver时出错:     错误:无法构建gem本机扩展。

current directory: /var/lib/gems/2.5.0/gems/childprocess-1.0.1/ext /usr/bin/ruby2.5 mkrf_conf.rb
     

当前目录:/var/lib/gems/2.5.0/gems/childprocess-1.0.1/ext   /usr/bin/ruby2.5 -rrubygems   /usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake   RUBYARCHDIR \ = / var / lib / gems / 2.5.0 / extensions / x86_64-linux / 2.5.0 / childprocess-1.0.1   RUBYLIBDIR \ = / var / lib / gems / 2.5.0 / extensions / x86_64-linux / 2.5.0 / childprocess-1.0.1   /usr/bin/ruby2.5:没有这样的文件或目录-   /usr/share/rubygems-integration/all/gems/rake-12.3.1/exe/rake   (LoadError)

     

耙失败,退出代码1

     

宝石文件将继续安装在   /var/lib/gems/2.5.0/gems/childprocess-1.0.1进行检查。结果   登录到   /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/childprocess-1.0.1/gem_make.out

我尝试过

sudo gem update --system
sudo apt install ruby-dev
sudo apt install build-essential
sudo apt install gcc
sudo apt install make


ruby -v ruby 2.5.5p157 (2019-03-15 revision 67260) [x86_64-linux-gnu]
gem -v 3.0.3

1 个答案:

答案 0 :(得分:0)

我必须这样做

sudo gem pristine rake
  

将宝石恢复到原始状态...耙12.3.1的缓存宝石不是   找到,尝试获取...正在获取rake-12.3.1.gem恢复   耙12.3.1