2014-01-18 3 views
0

Я застрял в течение недели, пытаясь понять это. В настоящее время я читаю онлайн-лекции, однако я строго следил за всем, и инструктор на самом деле не помогает. Когда я пытаюсь нажать на герою, я получаю следующее:Heroku: Push отклонено, не удалось скомпилировать приложение Ruby

Инициализация хранилища, завершена. Подсчет объектов: 85, сделано. Дельта-сжатие с использованием до 2 потоков. Сжатие объектов: 100% (76/76), сделано. Написание объектов: 100% (85/85), 27.36 KiB, сделано. Всего 85 (дельта 6), повторно 0 (дельта 0)

-----> Ruby app detected 
-----> Compiling Ruby/Rails 
-----> Using Ruby version: ruby-2.0.0 
-----> Warning: 
     Removing `Gemfile.lock` because it was generated on Windows. 
     Bundler will do a full resolve so native gems are handled properly. 
     This may result in unexpected gem versions being used in your app. 
     In rare occasions Bundler may not be able to resolve your dependencies 
all. 
     https://devcenter.heroku.com/articles/bundler-windows-gemfile 
-----> Installing dependencies using Bundler version 1.5.2 
     New app detected loading default bundler cache 
     Running: bundle install --without development:test --path vendor/bundl 
-binstubs vendor/bundle/bin -j4 
     Your Gemfile lists the gem sqlite3 (>= 0) more than once. 
     You should probably keep only one of them. 
     While it's not a problem now, it could cause errors if you change the 
sion of just one of them later. 
     Your Gemfile lists the gem sqlite3 (>= 0) more than once. 
     You should probably keep only one of them. 
     While it's not a problem now, it could cause errors if you change the 
sion of just one of them later. 
     Your Gemfile lists the gem rspec-rails (= 2.6.1) more than once. 
     You should probably keep only one of them. 
     While it's not a problem now, it could cause errors if you change the 
sion of just one of them later. 
     Fetching gem metadata from https://rubygems.org/......... 
     Fetching additional metadata from https://rubygems.org/.. 
     Resolving dependencies... 
     Using builder (3.0.4) 
     Using erubis (2.7.0) 
     Using journey (1.0.4) 
     Using rack (1.4.5) 
     Using hike (1.2.3) 
     Using tilt (1.4.1) 
     Installing i18n (0.6.1) 
     Using polyglot (0.3.3) 
     Installing mime-types (1.25.1) 
     Using tzinfo (0.3.38) 
     Using bundler (1.5.2) 
     Using coffee-script-source (1.6.3) 
     Using execjs (2.0.2) 
     Using json (1.8.1) 
     Using thor (0.18.1) 
     Installing multi_json (1.8.4) 
     Installing rake (10.1.1) 
     Installing arel (3.0.3) 
     Using rack-cache (1.2) 
     Using rack-test (0.6.2) 
     Using rack-ssl (1.3.3) 
     Using treetop (1.4.15) 
     Using coffee-script (2.2.0) 
     Using rdoc (3.12.2) 
     Installing sass (3.2.13) 
     Installing uglifier (2.4.0) 
     Using sprockets (2.2.2) 
     Using mail (2.5.4) 
     Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native 
tension. 
     /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0.0/bin/ 
y extconf.rb 
     checking for sqlite3.h... no 
     sqlite3.h is missing. Try 'port install sqlite3 +universal' 
     or 'yum install sqlite-devel' and check your shared library search pat 
the 
     location where your sqlite3 shared library is located). 
     *** extconf.rb failed *** 
     Could not create Makefile due to some reason, probably lack of necessa 
     libraries and/or headers. Check the mkmf.log file for more details. 
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=/tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0 
bin/ruby 
     --with-sqlite3-dir 
     --without-sqlite3-dir 
     --with-sqlite3-include 
     --without-sqlite3-include=${sqlite3-dir}/include 
     --with-sqlite3-lib 
     --without-sqlite3-lib=${sqlite3-dir}/ 
     --enable-local 
     --disable-local 
     Gem files will remain installed in /tmp/build_903734dc-f591-44eb-8891- 
ba3caf9e0/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection. 
     Results logged to /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vend 
bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out 
     Installing activesupport (3.2.13) 
     Installing pg (0.17.1) 
     An error occurred while installing sqlite3 (1.3.8), and Bundler cannot 
ntinue. 
     Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundli 

     Bundler Output: Your Gemfile lists the gem sqlite3 (>= 0) more than on 

     You should probably keep only one of them. 
     While it's not a problem now, it could cause errors if you change the 
sion of just one of them later. 
     Your Gemfile lists the gem sqlite3 (>= 0) more than once. 
     You should probably keep only one of them. 
     While it's not a problem now, it could cause errors if you change the 
sion of just one of them later. 
     Your Gemfile lists the gem rspec-rails (= 2.6.1) more than once. 
     You should probably keep only one of them. 
     While it's not a problem now, it could cause errors if you change the 
sion of just one of them later. 
     Fetching gem metadata from https://rubygems.org/......... 
     Fetching additional metadata from https://rubygems.org/.. 
     Resolving dependencies... 
     Using builder (3.0.4) 
     Using erubis (2.7.0) 
     Using journey (1.0.4) 
     Using rack (1.4.5) 
     Using hike (1.2.3) 
     Using tilt (1.4.1) 
     Installing i18n (0.6.1) 
     Using polyglot (0.3.3) 
     Installing mime-types (1.25.1) 
     Using tzinfo (0.3.38) 
     Using bundler (1.5.2) 
     Using coffee-script-source (1.6.3) 
     Using execjs (2.0.2) 
     Using json (1.8.1) 
     Using thor (0.18.1) 
     Installing multi_json (1.8.4) 
     Installing rake (10.1.1) 
     Installing arel (3.0.3) 
     Using rack-cache (1.2) 
     Using rack-test (0.6.2) 
     Using rack-ssl (1.3.3) 
     Using treetop (1.4.15) 
     Using coffee-script (2.2.0) 
     Using rdoc (3.12.2) 
     Installing sass (3.2.13) 
     Installing uglifier (2.4.0) 
     Using sprockets (2.2.2) 
     Using mail (2.5.4) 

     Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native 
tension. 

     /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0.0/bin/ 
y extconf.rb 
     checking for sqlite3.h... no 
     sqlite3.h is missing. Try 'port install sqlite3 +universal' 
     or 'yum install sqlite-devel' and check your shared library search pat 
the 
     location where your sqlite3 shared library is located). 
     *** extconf.rb failed *** 
     Could not create Makefile due to some reason, probably lack of necessa 
     libraries and/or headers. Check the mkmf.log file for more details. 
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=/tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vendor/ruby-2.0 
bin/ruby 
     --with-sqlite3-dir 
     --without-sqlite3-dir 
     --with-sqlite3-include 
     --without-sqlite3-include=${sqlite3-dir}/include 
     --with-sqlite3-lib 
     --without-sqlite3-lib=${sqlite3-dir}/ 
     --enable-local 
     --disable-local 


     Gem files will remain installed in /tmp/build_903734dc-f591-44eb-8891- 
ba3caf9e0/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection. 
     Results logged to /tmp/build_903734dc-f591-44eb-8891-428ba3caf9e0/vend 
bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out 
     Installing activesupport (3.2.13) 
     Installing pg (0.17.1) 
     An error occurred while installing sqlite3 (1.3.8), and Bundler cannot 
ntinue. 
     Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundli 

! 
!  Failed to install gems via Bundler. 
! 
!  Detected sqlite3 gem which is not supported on Heroku. 
!  https://devcenter.heroku.com/articles/sqlite3 
! 

!  Push rejected, failed to compile Ruby app 

To [email protected]:tranquil-ridge-7489.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to '[email protected]:tranquil-ridge-7489.git' 

Я пытался восстанавливать файлы гем, удаление gemfile.lock и запуск пучка установки, после решения из предыдущих вопросов, но я до сих пор получив эту ошибку.

Вот мой текущий Gemfile:

source 'https://rubygems.org' 

gem 'rails', '3.2.13' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'sqlite3' 


# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '~> 3.2.3' 
    gem 'coffee-rails', '~> 3.2.1' 

    # See https://github.com/sstephenson/execjs#readme for more supported runtimes 
    # gem 'therubyracer', :platforms => :ruby 

    gem 'uglifier', '>= 1.0.3' 
end 

gem 'jquery-rails' 

# To use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# To use Jbuilder templates for JSON 
# gem 'jbuilder' 

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

# Deploy with Capistrano 
# gem 'capistrano' 

# To use debugger 
# gem 'debugger' 

group :development do 
    gem 'sqlite3' 
    gem 'rspec-rails', '2.6.1', :require => 'rspec-rails' 
    gem 'faker', '0.3.1' 
end 

group :test do 
    gem 'sqlite3' 
    gem 'rspec-rails', '2.6.1', :require => 'rpec-rails' 
    gem 'webrat', '0.7.1' 
    gem 'factory_girl_rails', '1.0' 
    gem 'turn', :require => false 
end 

group :production do 
    gem 'pg' 
end 

Любая помощь по этому вопросу?

+0

Возможный дубликат [push to heroku problems: sqlite/gems/bundler] (http://stackoverflow.com/questions/17077401/push-to-heroku-problems-sqlite-gems-bundler) –

ответ

4

Я рекомендовал бы несколько вещей:

1) Следуйте инструкциям here к обратитесь к Gemfile вопросам, возникающим при развертывании проекта Ruby, сгенерированного в Windows.

2) Выполните следующие действия в вашем Gemfile

group :test, :production do 
    gem 'pg' 
end 

group :development do 
    gem 'sqlite3' 
end 

Это избавляется от sqlite3 от развертывания производства. Используйте его для тестирования модулей и интеграции, но используйте PostgreSQL для принятия/функционального тестирования, потому что это РСУБД по выбору на Heroku. Кроме того, ссылайтесь на свои драгоценные камни только один раз.

3) Настройте Hobby Dev version of the PostgreSQL add-on в своей среде развертывания на Heroku.

0

You can't use SQLite on Heroku, вам придется использовать PostgreSQL.

Вы можете настроить его для использования PostgreSQL на Heroku, но SQLite в разработке, рекомендуется использовать одну и ту же базу данных в вашей среде разработки и производства.

Обратите внимание, что вы перечисляете gem 'sqlite3' несколько раз, в том числе один за пределами группы разработчиков. Это заставляет Heroku пытаться установить его.

Мое предложение - полностью удалить драгоценный камень sqlite и переключить его на PostgreSQL.

0

удалить верхний gem sqlite3 и добавить ruby '2.0.0' в верхней части Gemfile

также при производстве группы добавить gem 'rails_12factor'

Смежные вопросы