Heroku - błąd przy stawianiu serwera

No i po raz kolejny… Jakie to wszystko diabelsko niepokorne. Wszystko się nie chce robić tak jak mówi tutorial. Do rzeczy…

Przygotowałem apke, jest na bitbucket no to pasuje ją wrzuć na heroku (tak mówi tutorial) wszystko fajnie, heroku version, heroku login, heroku key:add, heroku create. Do tego miejsca wszystko ok…

następne jest git push heroku master

i tutaj tak:

Counting objects: 86, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (78/78), done.
Writing objects: 100% (86/86), 19.18 KiB | 0 bytes/s, done.
Total 86 (delta 10), 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 1.6.3
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:        Installing rake 10.4.2
remote:        Installing i18n 0.7.0.beta1
remote:        Installing thread_safe 0.3.4
remote:        Installing minitest 5.4.3
remote:        Installing builder 3.2.2
remote:        Installing erubis 2.7.0
remote:        Installing mini_portile 0.6.1
remote:        Installing mime-types 2.4.3
remote:        Installing rack 1.6.0.beta2
remote:        Installing coffee-script-source 1.8.0
remote:        Installing arel 6.0.0
remote:        Installing execjs 2.2.2
remote:        Installing json 1.8.1
remote:        Installing thor 0.19.1
remote:        Installing hike 1.2.3
remote:        Using bundler 1.6.3
remote:        Installing multi_json 1.10.1
remote:        Installing rails_serve_static_assets 0.0.2
remote:        Installing tilt 1.4.1
remote:        Installing rails_stdout_logging 0.0.3
remote:        Installing sass 3.4.9
remote:        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
remote:        /tmp/build_8c2c5bc85f41682407cc812cd62b2753/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_8c2c5bc85f41682407cc812cd62b2753/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_8c2c5bc85f41682407cc812cd62b2753/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
remote:        Results logged to /tmp/build_8c2c5bc85f41682407cc812cd62b2753/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
remote:        Installing tzinfo 1.2.2
remote:        Installing pg 0.17.1
remote:        An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.10'` succeeds before bundling.
remote:        Bundler Output: Fetching gem metadata from https://rubygems.org/.........
remote:        Installing rake 10.4.2
remote:        Installing i18n 0.7.0.beta1
remote:        Installing thread_safe 0.3.4
remote:        Installing minitest 5.4.3
remote:        Installing builder 3.2.2
remote:        Installing erubis 2.7.0
remote:        Installing mini_portile 0.6.1
remote:        Installing mime-types 2.4.3
remote:        Installing rack 1.6.0.beta2
remote:        Installing coffee-script-source 1.8.0
remote:        Installing arel 6.0.0
remote:        Installing execjs 2.2.2
remote:        Installing json 1.8.1
remote:        Installing thor 0.19.1
remote:        Installing hike 1.2.3
remote:        Using bundler 1.6.3
remote:        Installing multi_json 1.10.1
remote:        Installing rails_serve_static_assets 0.0.2
remote:        Installing tilt 1.4.1
remote:        Installing rails_stdout_logging 0.0.3
remote:        Installing sass 3.4.9
remote:        
remote:        Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
remote:        
remote:        /tmp/build_8c2c5bc85f41682407cc812cd62b2753/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_8c2c5bc85f41682407cc812cd62b2753/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_8c2c5bc85f41682407cc812cd62b2753/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10 for inspection.
remote:        Results logged to /tmp/build_8c2c5bc85f41682407cc812cd62b2753/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.10/ext/sqlite3/gem_make.out
remote:        Installing tzinfo 1.2.2
remote:        Installing pg 0.17.1
remote:        An error occurred while installing sqlite3 (1.3.10), and Bundler cannot
remote:        continue.
remote:        Make sure that `gem install sqlite3 -v '1.3.10'` 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 still-falls-7928.
remote: 
To https://git.heroku.com/still-falls-7928.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/still-falls-7928.git'

ta końcówka jest dla mnie zastanawiająca:

To https://git.heroku.com/still-falls-7928.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/still-falls-7928.git'

oczywiście link jaki podał mi heroku to: https://warm-headland-8806.herokuapp.com/ i powinien on wyświetać ‘hello world’ no a nie wyświetla…

Czemu nic nie może sie udać tak po prostu? :smiley:

Z tego co widzę używasz sqlite na produkcji zmień na postrgresa https://devcenter.heroku.com/articles/sqlite3.

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

Tutaj masz dokładnie napisane dlaczego nie działa. Zaskakująca końcówka tylko z tego wynika.

oczywiście przy próbach naprawy zepsułem wszystko :smiley: bo miałem tak w configu:

group :production do
  gem 'pg',             '0.17.1'
  gem 'rails_12factor', '0.0.2'
end

to jak zmieniłem gem ‘sqlite3’ na gem ‘pg’ a ten usunąłem to już w ogóle teraz nie chce to wszystko działać :smiley:

bo jeszcze konfiguracje w database.yml musisz zmienic i skonfigurowac postgresa

Daj gem ‘sqlite3’ do groupy development, a pg do production. Chociaż i tak może być wymagane zainstalowanie pg na twoim komputerze.

środowisko development (rozwojowe) jest używane na komputerze programisty, aby mógł oglądać bezpośrednio rezultaty wprowadzanych zmian
środowisko test (testowe) służy do uruchamiania automatycznych testów
środowisko production (produkcyjne) jest używane kiedy aplikacja uruchomiona jest na serwerze produkcyjnym

Za http://www.apohllo.pl/guides/getting_started.html

zainstalowałem gem ‘pg’

dodałem do Gemlist gem ‘pg’ (później gem ‘pg’, gem ‘sq’, ‘~> 0.1.4’)

próbowałem wszystkich możliwości… jutro chyba postawie to od nowa…
Zanim to zrobie jednak tjeden udostepniłem Ci to repozytorium na bitbucket. Jakbyś mógł to prosze looknij.

i jak coś poprawisz to napisz mi jeszcze jakbyś mógl jak stamtąd pobrać coś na komp bo odwrotnie to chyba umiem. Ale w tą strone nie :stuck_out_tongue:
z góry serdeczne dzięki ;]

i cała reszta… zmieniłem repozytorium na publiczne. kto ma ochote pomóc to oglądać:

https://dominik23213@bitbucket.org/dominik23213/hello_appp.git

zwróć uwagę na: [quote=“nightreapper, post:5, topic:9042, full:true”]
bo jeszcze konfiguracje w database.yml musisz zmienic i skonfigurowac postgresa
[/quote]
Może https://devcenter.heroku.com/articles/getting-started-with-ruby#use-a-database pomoże?

z tego co pamiętam to heroku podmieniało plik database.yml i nic tam nie trzeba było ustawiać, lub jakoś inaczej to robiło, ale w database.yml nic nie musiałem zmieniać.