ruby-on-rails – 安装sqlite3时发生导轨应用程序到Heroku错误的错误,Bundler无法继续

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – 安装sqlite3时发生导轨应用程序到Heroku错误的错误,Bundler无法继续前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
参见英文答案 > Deploying RoR app to Heroku with Sqlite3 fails6
我试图把我的rails应用程序推送到heroku,并收到以下错误

  1. Counting objects: 177,done. Delta compression using up to 2 threads.
  2. Compressing objects: 100% (161/161),done. Writing objects: 100%
  3. (177/177),44.73 KiB,done. Total 177 (delta 39),reused 0 (delta 0)
  4.  
  5. -----> Heroku receiving push
  6. -----> Ruby/Rails app detected
  7. -----> Installing dependencies using Bundler version 1.2.1
  8. Running: bundle install --without development:test --path vendor/bundle -
  9. -binstubs bin/
  10. Fetching gem Metadata from
  11. Fetching gem Metadata from
  12. Installing rake (10.0.2)
  13. Installing i18n (0.6.1)
  14. Installing multi_json (1.3.7)
  15. Installing activesupport (3.2.8)
  16. Installing builder (3.0.4)
  17. Installing activemodel (3.2.8)
  18. Installing erubis (2.7.0)
  19. Installing journey (1.0.4)
  20. Installing rack (1.4.1)
  21. Installing rack-cache (1.2)
  22. Installing rack-test (0.6.2)
  23. Installing hike (1.2.1)
  24. Installing tilt (1.3.3)
  25. Installing sprockets (2.1.3)
  26. Installing actionpack (3.2.8)
  27. Installing mime-types (1.19)
  28. Installing polyglot (0.3.3)
  29. Installing treetop (1.4.12)
  30. Installing mail (2.4.4)
  31. Installing actionmailer (3.2.8)
  32. Installing arel (3.0.2)
  33. Installing tzinfo (0.3.35)
  34. Installing activerecord (3.2.8)
  35. Installing activeresource (3.2.8)
  36. Using bundler (1.2.1)
  37. Installing coffee-script-source (1.4.0)
  38. Installing execjs (1.4.0)
  39. Installing coffee-script (2.2.0)
  40. Installing rack-ssl (1.3.2)
  41. Installing json (1.7.5) with native extensions
  42. Installing rdoc (3.12)
  43. Installing thor (0.16.0)
  44. Installing railties (3.2.8)
  45. Installing coffee-rails (3.2.2)
  46. Installing jquery-rails (2.1.3)
  47. Installing rails (3.2.8)
  48. Installing sass (3.2.3)
  49. Installing sass-rails (3.2.5)
  50. Installing sqlite3 (1.3.6) with native extensions
  51. Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native ex tension.
  52. /usr/local/bin/ruby extconf.rb
  53. checking for sqlite3.h... no
  54. sqlite3.h is missing. Try 'port install sqlite3 +universal'
  55. or 'yum install sqlite-devel' and check your shared library search path ( the
  56. location where your sqlite3 shared library is located).
  57. *** extconf.rb Failed ***
  58. Could not create Makefile due to some reason,probably lack of
  59. necessary libraries and/or headers. Check the mkmf.log file for more
  60. details. You may need configuration options.
  61. Provided configuration options:
  62. --with-opt-dir
  63. --without-opt-dir
  64. --with-opt-include
  65. --without-opt-include=${opt-dir}/include
  66. --with-opt-lib
  67. --without-opt-lib=${opt-dir}/lib
  68. --with-make-prog
  69. --without-make-prog
  70. --srcdir=.
  71. --curdir
  72. --ruby=/usr/local/bin/ruby
  73. --with-sqlite3-dir
  74. --without-sqlite3-dir
  75. --with-sqlite3-include
  76. --without-sqlite3-include=${sqlite3-dir}/include
  77. --with-sqlite3-lib
  78. --without-sqlite3-lib=${sqlite3-dir}/lib
  79. --enable-local
  80. --disable-local
  81. Gem files will remain installed in /tmp/build_2pense1pvyqut/vendor/bundle /ruby/1.9.1/gems/sqlite3-1.3.6
  82. for inspection.
  83. Results logged to /tmp/build_2pense1pvyqut/vendor/bundle/ruby/1.9.1/gems/
  84. sqlite3-1.3.6/ext/sqlite3/gem_make.out
  85. An error occurred while installing sqlite3 (1.3.6),and Bundler cannot co ntinue.
  86. Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
  87.  
  88. ! ! Failed to install gems via Bundler. ! ! Heroku push
  89. rejected,Failed to compile Ruby/rails app

=========================================

我的GemFile如下:

=======================================

  1. gem 'rails','3.2.8'
  2.  
  3. # Bundle edge Rails instead:
  4. # gem 'rails',:git => 'git://github.com/rails/rails.git'
  5.  
  6. group :production do gem 'pg' end
  7.  
  8. group :development,:test do gem 'taps' gem 'rvm'
  9. gem 'rspec-rails','2.0.1' gem 'annotate' gem 'faker','0.3.1' gem 'rspec','2.0.1' gem 'webrat','0.7.1' gem 'spork','0.8.4'
  10. gem 'factory_girl_rails','1.0' end
  11.  
  12. gem 'rake','~> 10.0.1'
  13.  
  14.  
  15.  
  16. #gem 'yaml_db'
  17.  
  18. # Gems used only for assets and not required
  19. # in production environments by default. group :assets do gem 'sass-rails','~> 3.2.3' gem 'coffee-rails','~> 3.2.1'
  20.  
  21. # See https://github.com/sstephenson/execjs#readme for more
  22. supported runtimes # gem 'therubyracer',:platforms => :ruby
  23.  
  24. gem 'uglifier','>= 1.0.3' end
  25.  
  26. gem 'jquery-rails'
  27.  
  28. # To use ActiveModel has_secure_password
  29. # gem 'bcrypt-ruby','~> 3.0.0'
  30.  
  31. # To use Jbuilder templates for JSON
  32. # gem 'jbuilder'
  33.  
  34. # Use unicorn as the app server
  35. # gem 'unicorn'
  36.  
  37. # Deploy with Capistrano
  38. # gem 'capistrano'
  39.  
  40. # To use debugger
  41. # gem 'debugger'

=======================================

我几乎尝试了在线提供的所有解决方案,但仍然没有运气.
任何帮助将不胜感激.

解决方法

我在上面的代码中没有看到它,但猜测你可能将gem’sqlite3’放在gemfile的顶部,因此它在所有环境中都被使用. Heroku不支持sqlite,所以它不再是生产组.尝试以下操作,以便您可以使用sqlite进行开发和测试,然后使用pg on Heroku.
  1. group :development,:test do
  2. gem 'sqlite3'
  3. end
  4.  
  5. group :production do
  6. gem 'pg'
  7. end

猜你在找的Ruby相关文章