在我的Gemfile中,我评论了行gem 'sqlite3'
,然后我运行了bundler update
和bundler install
以及git add .
和git commit -m "..."
。但是当我尝试git push heroku master
时,错误不断出现。
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.2'
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platform: :mri
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.0.5'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
end
group :production do
gem 'pg'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'devise'
Counting objects: 85, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (70/70), done.
Writing objects: 100% (85/85), 20.12 KiB | 0 bytes/s, done.
Total 85 (delta 2), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using bundler 1.13.7
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Installing i18n 0.8.1
remote: Installing concurrent-ruby 1.0.5
remote: Installing rake 12.0.0
remote: Installing minitest 5.10.1
remote: Installing thread_safe 0.3.6
remote: Installing builder 3.2.3
remote: Installing erubis 2.7.0
remote: Installing mini_portile2 2.1.0
remote: Installing rack 2.0.1
remote: Installing nio4r 2.0.0 with native extensions
remote: Installing websocket-extensions 0.1.2
remote: Installing arel 7.1.4
remote: Installing mime-types-data 3.2016.0521
remote: Installing execjs 2.7.0
remote: Installing coffee-script-source 1.12.2
remote: Installing method_source 0.8.2
remote: Installing thor 0.19.4
remote: Installing multi_json 1.12.1
remote: Using bundler 1.13.7
remote: Installing puma 3.8.2 with native extensions
remote: Installing sass 3.4.23
remote: Installing tilt 2.0.7
remote: Installing sqlite3 1.3.13 with native extensions
remote: Installing turbolinks-source 5.0.0
remote: Installing tzinfo 1.2.3
remote: Installing nokogiri 1.7.1 with native extensions
remote: Installing rack-test 0.6.3
remote: Installing sprockets 3.7.1
remote: Installing websocket-driver 0.6.5 with native extensions
remote: Installing mime-types 3.1
remote: Installing uglifier 3.2.0
remote: Installing coffee-script 2.4.1
remote: Installing turbolinks 5.0.1
remote: Installing activesupport 5.0.2
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote: current directory:
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/ruby-2.3.4/bin/ruby -r
remote: ./siteconf20170519-225-1fsl87m.rb extconf.rb
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'brew install sqlite3',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
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: 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_c7d63c20559c9c0f3d363c105f864362/vendor/ruby-2.3.4/bin/$(RUBY_BASE_NAME)
remote: --with-sqlite3-config
remote: --without-sqlite3-config
remote: --with-pkg-config
remote: --without-pkg-config
remote: --with-sqlite3-dir
remote: --without-sqlite3-dir
remote: --with-sqlite3-include
remote: --without-sqlite3-include=${sqlite3-dir}/include
remote: --with-sqlite3-lib
remote: --without-sqlite3-lib=${sqlite3-dir}/lib
remote: To see why this extension failed to compile, please check the mkmf.log which can
remote: be found here:
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log
remote: extconf failed, exit code 1
remote: Gem files will remain installed in
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13
remote: for inspection.
remote: Results logged to
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote: Bundler Output: Warning: the running version of Bundler (1.13.7) is older than the version that created the lockfile (1.14.6). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Installing i18n 0.8.1
remote: Installing concurrent-ruby 1.0.5
remote: Installing rake 12.0.0
remote: Installing minitest 5.10.1
remote: Installing thread_safe 0.3.6
remote: Installing builder 3.2.3
remote: Installing erubis 2.7.0
remote: Installing mini_portile2 2.1.0
remote: Installing rack 2.0.1
remote: Installing nio4r 2.0.0 with native extensions
remote: Installing websocket-extensions 0.1.2
remote: Installing arel 7.1.4
remote: Installing mime-types-data 3.2016.0521
remote: Installing execjs 2.7.0
remote: Installing coffee-script-source 1.12.2
remote: Installing method_source 0.8.2
remote: Installing thor 0.19.4
remote: Installing multi_json 1.12.1
remote: Using bundler 1.13.7
remote: Installing puma 3.8.2 with native extensions
remote: Installing sass 3.4.23
remote: Installing tilt 2.0.7
remote: Installing sqlite3 1.3.13 with native extensions
remote: Installing turbolinks-source 5.0.0
remote: Installing tzinfo 1.2.3
remote: Installing nokogiri 1.7.1 with native extensions
remote: Installing rack-test 0.6.3
remote: Installing sprockets 3.7.1
remote: Installing websocket-driver 0.6.5 with native extensions
remote: Installing mime-types 3.1
remote: Installing uglifier 3.2.0
remote: Installing coffee-script 2.4.1
remote: Installing turbolinks 5.0.1
remote: Installing activesupport 5.0.2
remote: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
remote:
remote: current directory:
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13/ext/sqlite3
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/ruby-2.3.4/bin/ruby -r
remote: ./siteconf20170519-225-1fsl87m.rb extconf.rb
remote: checking for sqlite3.h... no
remote: sqlite3.h is missing. Try 'brew install sqlite3',
remote: 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
remote: and check your shared library search path (the
remote: location where your sqlite3 shared library is located).
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_c7d63c20559c9c0f3d363c105f864362/vendor/ruby-2.3.4/bin/$(RUBY_BASE_NAME)
remote: --with-sqlite3-config
remote: --without-sqlite3-config
remote: --with-pkg-config
remote: --without-pkg-config
remote: --with-sqlite3-dir
remote: --without-sqlite3-dir
remote: --with-sqlite3-include
remote: --without-sqlite3-include=${sqlite3-dir}/include
remote: --with-sqlite3-lib
remote: --without-sqlite3-lib=${sqlite3-dir}/lib
remote:
remote: To see why this extension failed to compile, please check the mkmf.log which can
remote: be found here:
remote:
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/mkmf.log
remote:
remote: extconf failed, exit code 1
remote:
remote: Gem files will remain installed in
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/gems/sqlite3-1.3.13
remote: for inspection.
remote: Results logged to
remote: /tmp/build_c7d63c20559c9c0f3d363c105f864362/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/sqlite3-1.3.13/gem_make.out
remote:
remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot
remote: continue.
remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling.
remote: !
remote: ! Failed to install gems via Bundler.
remote: ! Detected sqlite3 gem which is not supported on Heroku:
remote: ! https://devcenter.heroku.com/articles/sqlite3
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to osty.
remote:
To https://git.heroku.com/osty.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/osty.git'
我该怎么做?
答案 0 :(得分:0)
Heroku无法以任何理由安装sqlite3 gem
您可以在gem文件中进行以下更改
在你的Gemfile中
gem 'sqlite3' (if you have)
到
gem 'pg'
注意:您必须运行
git add .
git commit
跑步前
git push heroku master
如果您想将sqllite
用于development
而postgress
用于Heroku,请使用以下配置。
group :development do
gem 'sqlite3' #gem to use in development environment
end
group :production do
gem 'pg' #gem to use in production environment
end
Heroku将使用pg gem,因为heroku在生产环境中运行你的应用程序