2015-11-17 112 views
1

我試圖將我的新導軌應用程序推到Heroku,但它不起作用。我嘗試了很多東西,比如:git push heroku主導軌錯誤

  1. 刪除Gemfile.lock的,創造一個又一個
  2. 運行包安裝和捆綁安裝--without生產
  3. 重新安裝寶石「PG」和「rails_12factor」

這就是當我輸入混帳推Heroku的主人是什麼出現在命令行:

Counting objects: 87, done. 
Delta compression using up to 8 threads. 
Compressing objects: 100% (73/73), done. 
Writing objects: 100% (87/87), 18.46 KiB | 0 bytes/s, done. 
Total 87 (delta 8), 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.0.0 
remote: -----> Installing dependencies using bundler 1.9.7 
remote:  Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 
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:  Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
remote:  Installing rake 10.4.2 
remote:  Installing i18n 0.7.0 
remote:  Installing json 1.8.3 
remote:  Installing minitest 5.8.2 
remote:  Installing thread_safe 0.3.5 
remote:  Installing tzinfo 1.2.2 
remote:  Installing activesupport 4.2.4 
remote:  Installing builder 3.2.2 
remote:  Installing erubis 2.7.0 
remote:  Installing mini_portile 0.6.2 
remote:  Installing nokogiri 1.6.6.2 
remote:  Installing rails-deprecated_sanitizer 1.0.3 
remote:  Installing rails-dom-testing 1.0.7 
remote:  Installing loofah 2.0.3 
remote:  Installing rails-html-sanitizer 1.0.2 
remote:  Installing actionview 4.2.4 
remote:  Installing rack 1.6.4 
remote:  Installing rack-test 0.6.3 
remote:  Installing actionpack 4.2.4 
remote:  Installing globalid 0.3.6 
remote:  Installing activejob 4.2.4 
remote:  Installing mime-types 2.6.2 
remote:  Installing mail 2.6.3 
remote:  Installing actionmailer 4.2.4 
remote:  Installing activemodel 4.2.4 
remote:  Installing arel 6.0.3 
remote:  Installing activerecord 4.2.4 
remote:  Installing coffee-script-source 1.9.1.1 
remote:  Installing execjs 2.6.0 
remote:  Installing coffee-script 2.4.1 
remote:  Installing thor 0.19.1 
remote:  Installing railties 4.2.4 
remote:  Installing coffee-rails 4.1.0 
remote:  Installing multi_json 1.11.2 
remote:  Installing jbuilder 2.3.2 
remote:  Installing jquery-rails 4.0.5 
remote:  Using bundler 1.9.7 
remote:  Installing sprockets 3.4.0 
remote:  Installing sprockets-rails 2.3.3 
remote:  Installing rails 4.2.4 
remote:  Installing rdoc 4.2.0 
remote:  Installing sass 3.4.19 
remote:  Installing tilt 2.0.1 
remote:  Installing sass-rails 5.0.4 
remote:  Installing sdoc 0.4.1 
remote:  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
remote:  /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby extconf.rb 
remote:  checking for sqlite3.h... no 
remote:  sqlite3.h is missing. Try 'port install sqlite3 +universal', 
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_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby 
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}/ 
remote:  Gem files will remain installed in /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection. 
remote:  Results logged to /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out 
remote:  An error occurred while installing sqlite3 (1.3.11), and Bundler cannot 
remote:  continue. 
remote:  Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling. 
remote:  Bundler Output: Fetching gem metadata from https://rubygems.org/........... 
remote:  Fetching version metadata from https://rubygems.org/... 
remote:  Fetching dependency metadata from https://rubygems.org/.. 
remote:  Rubygems 2.0.14 is not threadsafe, so your gems must be installed one at a time. Upgrade to Rubygems 2.1.0 or higher to enable parallel gem installation. 
remote:  Installing rake 10.4.2 
remote:  Installing i18n 0.7.0 
remote:  Installing json 1.8.3 
remote:  Installing minitest 5.8.2 
remote:  Installing thread_safe 0.3.5 
remote:  Installing tzinfo 1.2.2 
remote:  Installing activesupport 4.2.4 
remote:  Installing builder 3.2.2 
remote:  Installing erubis 2.7.0 
remote:  Installing mini_portile 0.6.2 
remote:  Installing nokogiri 1.6.6.2 
remote:  Installing rails-deprecated_sanitizer 1.0.3 
remote:  Installing rails-dom-testing 1.0.7 
remote:  Installing loofah 2.0.3 
remote:  Installing rails-html-sanitizer 1.0.2 
remote:  Installing actionview 4.2.4 
remote:  Installing rack 1.6.4 
remote:  Installing rack-test 0.6.3 
remote:  Installing actionpack 4.2.4 
remote:  Installing globalid 0.3.6 
remote:  Installing activejob 4.2.4 
remote:  Installing mime-types 2.6.2 
remote:  Installing mail 2.6.3 
remote:  Installing actionmailer 4.2.4 
remote:  Installing activemodel 4.2.4 
remote:  Installing arel 6.0.3 
remote:  Installing activerecord 4.2.4 
remote:  Installing coffee-script-source 1.9.1.1 
remote:  Installing execjs 2.6.0 
remote:  Installing coffee-script 2.4.1 
remote:  Installing thor 0.19.1 
remote:  Installing railties 4.2.4 
remote:  Installing coffee-rails 4.1.0 
remote:  Installing multi_json 1.11.2 
remote:  Installing jbuilder 2.3.2 
remote:  Installing jquery-rails 4.0.5 
remote:  Using bundler 1.9.7 
remote:  Installing sprockets 3.4.0 
remote:  Installing sprockets-rails 2.3.3 
remote:  Installing rails 4.2.4 
remote:  Installing rdoc 4.2.0 
remote:  Installing sass 3.4.19 
remote:  Installing tilt 2.0.1 
remote:  Installing sass-rails 5.0.4 
remote:  Installing sdoc 0.4.1 
remote:   
remote:  Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. 
remote:   
remote:  /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby extconf.rb 
remote:  checking for sqlite3.h... no 
remote:  sqlite3.h is missing. Try 'port install sqlite3 +universal', 
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_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby 
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}/ 
remote:   
remote:   
remote:  Gem files will remain installed in /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11 for inspection. 
remote:  Results logged to /tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.11/ext/sqlite3/gem_make.out 
remote:  An error occurred while installing sqlite3 (1.3.11), and Bundler cannot 
remote:  continue. 
remote:  Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling. 
remote: ! 
remote: !  Failed to install gems via Bundler. 
remote: !  
remote: !  Detected sqlite3 gem which is not supported on Heroku. 
remote: !  https://devcenter.heroku.com/articles/sqlite3 
remote: ! 
remote: 
remote: !  Push rejected, failed to compile Ruby app 
remote: 
remote: Verifying deploy... 
remote: 
remote: ! Push rejected to salty-oasis-5413. 
remote: 
To https://git.heroku.com/salty-oasis-5413.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'https://git.heroku.com/salty-oasis-5413.git' 

我在一些教程中看到,第一次執行此命令時,heroku會要求您輸入密碼,但在我的情況下卻沒有。

我的寶石文件

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.2.4' 
# Use sqlite3 as the database for Active Record 
gem 'pg', '~> 0.18.4' 
gem 'rails_12factor', '~>0.0.3' 

# 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.1.0' 
# See https://github.com/rails/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 
gem 'byebug', '~>6.0.2' 
gem 'web-console', '~> 2.0' 
gem 'spring', '~>1.4.0' 
# Use jquery as the JavaScript library 
gem 'jquery-rails' 
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
gem 'turbolinks' 
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 2.0' 
# bundle exec rake doc:rails generates the API under doc/api. 
gem 'sdoc', '~> 0.4.0', group: :doc 
gem 'bootstrap-sass', '~> 3.3', '>= 3.3.5.1' 
# Use ActiveModel has_secure_password 
# gem 'bcrypt', '~> 3.1.7' 

# Use Unicorn as the app server 
# gem 'unicorn' 

# 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 'sqlite3', '1.3.11' 

end 

group :production do 
    gem 'pg', '~> 0.18.4' 
    gem 'rails_12factor', '~>0.0.3' 
end 
    # Access an IRB console on exception pages or by using <%= console %> in views 


    # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 

謝謝你們。

+0

這看起來很嚴重: 遠程:Gem :: Installer :: ExtensionBuildError:錯誤:無法構建gem本機擴展。 遠程:/tmp/build_0e499d4b3416be94496280d6a0cdf1f8/vendor/ruby-2.0.0/bin/ruby extconf.rb 遠程:檢查sqlite3.h ...沒有 遠程:sqlite3.h丟失。嘗試'port install sqlite3 + universal', remote:'yum install sqlite-devel'或'apt-get install libsqlite3-dev' remote:並檢查你的共享庫搜索路徑( remote:你的sqlite3共享庫的位置位於)。 遠程:*** extconf.rb失敗*** – davejagoda

回答

0

問題是沒有安裝sqllite以便安裝完成。 因此,安裝sqllite3作爲您的依賴項之一併安裝它

+0

我安裝了sqlite3 gem。我已將該軟件包安裝在我的電腦中 – Sara

+0

heroku是有人服務器,並通過上述命令將您的代碼推送給其他人的服務器。 heroku服務器還必須安裝sqllite。所以在ruby的依賴管理文件中添加sqlite3。 – Pradheep

+0

將sqlite-devel添加到您在此https://devcenter.heroku.com/articles/getting-started-with-ruby#declare-app-dependencies – Pradheep