Ruby on rails 无法在Rails 4中使用bundle install命令安装capybara webkit
在Rails 4应用程序中执行命令Ruby on rails 无法在Rails 4中使用bundle install命令安装capybara webkit,ruby-on-rails,ruby,rubygems,capybara,capybara-webkit,Ruby On Rails,Ruby,Rubygems,Capybara,Capybara Webkit,在Rails 4应用程序中执行命令bundle install时,我遇到以下错误 > ruby -v ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32] > rails --version Could not find gem 'capybara-webkit x86-mingw32' in any of the gem sources listed in your Gemfile or available on th
bundle install
时,我遇到以下错误
> ruby -v
ruby 2.1.8p440 (2015-12-16 revision 53160) [i386-mingw32]
> rails --version
Could not find gem 'capybara-webkit x86-mingw32' in any of the gem sources listed in your Gemfile or available on this machine.
Run `bundle install` to install missing gems.
我的文件
...
.....
group :development, :localtesting, :test do
gem 'sqlite3', '1.3.11'
gem 'byebug', '3.4.0'
#gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
gem 'i18n-tasks'
gem 'capybara'
gem 'selenium-webdriver'
gem 'rspec'
gem 'rspec-rails'
gem 'rspec_junit_formatter'
gem 'capybara-webkit'
end
.....
...
错误
Installing capybara-webkit 1.10.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
*** 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=C:/RailsInstaller/Ruby2.1.0/bin/ruby
--with-gl-dir
--without-gl-dir
--with-gl-include
--without-gl-include=${gl-dir}/include
--with-gl-lib
--without-gl-lib=${gl-dir}/lib
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
Command 'qmake ' not available
extconf failed, exit code 1
Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/capybara-webkit-1.10.1 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/capybara-webkit-1.10.1/gem_make.out
Using guard-minitest 2.3.1
Using actionview 4.2.2
Using composite_primary_keys 8.1.2
Using friendly_id 5.1.0
Using paper_trail 4.0.2
An error occurred while installing capybara-webkit (1.10.1), and Bundler cannot
continue.
Make sure that `gem install capybara-webkit -v '1.10.1'` succeeds before
bundling.
注意:我已经尝试查看一篇有类似问题的文章,并尝试通过执行以下命令来遵循解决方案。但出现了以下错误
> qmake -v
'qmake' is not recognized as an internal or external command,
operable program or batch file.
安装说明位于capybara webkit wiki-。您需要安装Qt 5.5.1(只有单独构建QtWebKit模块时才支持5.6)我有OS X El Capitan系统。 我跟踪了这个链接: 然后 这个问题已经解决。Ubuntu
sudo apt-get update
sudo apt-get install qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
无法识别“qmake”
可能表示未安装Qt
brew update
cd $( brew --prefix )/Homebrew/Library/Taps/homebrew/homebrew-core
git checkout 9ba3d6ef8891e5c15dbdc9333f857b13711d4e97 Formula/qt@5.5.rb
brew install qt@5.5
echo 'export PATH="$(brew --prefix qt@5.5)/bin:$PATH"' >> ~/.bashrc
完整的安装过程是我必须运行:
QMAKE="$(brew --prefix qt@5.5)/bin/qmake" gem install capybara-webkit
为了在我出错后安装gem:qt@5.5:未知版本:mountain_lion
,并按照以下步骤进行评论:
注意:如果出现错误:qt@5.5:未知版本:mountain_lion,公式中的注释行#25/qt@5.5.rb因为它应该执行以下操作:
$ export PATH=/usr/share/qt5/bin:$PATH
$ bundle
我已经这样做了(OSX High Sierra),但gem安装仍然不起作用:“哪个qmake”=>“/usr/local/opt?”/qt@5.5/bin/qmake“但是安装Gem给了我“Command'qmake'failed”@sixty4bit这不是这个问题所处理的错误,
Command'qmake'不可用
-所以这里真的不是问这个问题的地方。用比此处提供的更多的详细信息打开您自己的问题。如果出现错误:error:qt@5.5:未知版本:mountain_lion
确保遵循文档中的注释:注意:如果出现错误:qt@5.5:未知版本:mountain_lion,公式中的注释行#25/qt@5.5.rb
$ export PATH=/usr/share/qt5/bin:$PATH
$ bundle