ruby-on-rails - Heroku 上的 Bundler 错误(使用 capybara gem)

标签 ruby-on-rails ruby ruby-on-rails-4 heroku

我有 Rails 应用程序,本地一切正常(服务器启动等) 但是当我不想在 heroku 上运行我的应用程序时,我遇到了问题(当我键入 git push heroku master 时:

remote: Installing capybara 2.4.4 remote: remote:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension. remote: remote:
/tmp/build_e1c43ae12e0eb81663efdbfcf4917456/vendor/ruby-2.1.5/bin/ruby extconf.rb remote: * extconf.rb failed * remote:
Could not create Makefile due to some reason, probably lack of necessary remote: libraries and/or headers. Check the mkmf.log file for more details. You may remote: need configuration options. remote: remote: Provided configuration options: remote: --with-opt-dir remote:
--without-opt-dir remote: --with-opt-include remote: --without-opt-include=${opt-dir}/include remote: --with-opt-lib remote: --without-opt-lib=${opt-dir}/lib remote:
--with-make-prog remote: --without-make-prog remote: --srcdir=. remote: --curdir remote: --ruby=/tmp/build_e1c43ae12e0eb81663efdbfcf4917456/vendor/ruby-2.1.5/bin/ruby remote: --with-gl-dir remote: --without-gl-dir remote:
--with-gl-include remote: --without-gl-include=${gl-dir}/include remote: --with-gl-lib remote: --without-gl-lib=${gl-dir}/lib remote:
--with-zlib-dir remote: --without-zlib-dir remote: --with-zlib-include remote: --without-zlib-include=${zlib-dir}/include remote: --with-zlib-lib remote: --without-zlib-lib=${zlib-dir}/lib remote: Command 'qmake ' not available remote: remote: extconf failed, exit code 1 remote: remote: Gem files will remain installed in /tmp/build_e1c43ae12e0eb81663efdbfcf4917456/vendor/bundle/ruby/2.1.0/gems/capybara-webkit-1.6.0 for inspection. remote: Results logged to /tmp/build_e1c43ae12e0eb81663efdbfcf4917456/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0-static/capybara-webkit-1.6.0/gem_make.out remote: An error occurred while installing capybara-webkit (1.6.0), and Bundler cannot remote: continue. remote:
Make sure that gem install capybara-webkit -v '1.6.0' succeeds before remote: bundling. remote: ! remote: ! Failed to install gems via Bundler. remote: ! remote: remote: ! Push rejected, failed to compile Ruby app remote: remote: Verifying deploy.... remote: remote: ! Push rejected to foosballtr. remote: To https://git.heroku.com/foosballtr.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/foosballtr.git'

这是我的 Gemfile:

source 'https://rubygems.org'
ruby '2.1.5'

gem 'rails', '4.1.8'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem "paperclip", "~> 4.3"
gem 'bootstrap-sass', '~> 3.3.5'
gem 'jquery-ui-rails'
gem 'jquery-turbolinks'
gem 'sprockets'
gem 'capybara-webkit'
gem "chartkick"

group :development do
  gem 'sqlite3'
end

group :production do
  gem 'pg'
  gem 'rails_12factor'
end

group :development, :test do  
  gem 'guard-rspec'  
  gem 'factory_girl_rails'  
  # gem 'pry-rails'  
  gem 'rspec-rails'  
  gem 'selenium-webdriver'
  gem 'capybara'  
end

最佳答案

gem 'capybara-webkit' 移动到 :development, :test 组,生产中不需要:

Many apps depend on gems with native extensions that need to be compiled on the deployment target.

Ref

group :development, :test do  
  gem 'guard-rspec'  
  gem 'factory_girl_rails'  
  # gem 'pry-rails'  
  gem 'rspec-rails'  
  gem 'capybara-webkit'
  gem 'selenium-webdriver'
  gem 'capybara'  
end

关于ruby-on-rails - Heroku 上的 Bundler 错误(使用 capybara gem),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31850955/

相关文章:

ruby-on-rails - 构建提醒电子邮件系统

Java 相当于 Ruby ObjectSpace.each_object

ruby-on-rails-4 - 带有 lambda 和 Rails 4 样式参数的范围?

ruby-on-rails - Ruby on Rails 回形针多重上传与嵌套属性

ruby-on-rails - 在 Heroku 上设置 Puma Worker 数量

ruby-on-rails - 您已经激活了rack 1.6.0,但是您的Gemfile 需要rack 1.6.4。在您的命令中添加 `bundle exec` 可能会解决这个问题。 ( gem ::加载错误)

ruby-on-rails - 将Elasticsearch与RSpec和Factorygirl一起使用

ruby - 没有足够的空间来安装 Ruby - Debian 7

ruby-on-rails - 如何在 Rails 4 中使用 @font-face 嵌入字体?

ruby - 如何在 has_many 关联中使用 Lambda