YvesCesar / students_attendance_system

Attendance students with facial recognition and notifies responsibles via email.
GNU General Public License v3.0
0 stars 0 forks source link

Implementar instância no heroku para entrega contínua #4

Closed YvesCesar closed 2 years ago

YvesCesar commented 2 years ago

Precisamos adicionar uma instância para realizar o deploy das implementações e entregar valor de forma contínua.

YvesCesar commented 2 years ago

Aparentemente tive um problema com o deploy devido a utilização do SQLite que vem por padrão no Rails. Sendo assim, vou adaptar o PostgreSQL para termos o primeiro deploy. Abaixo o erro que tive:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

       current directory:
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/sqlite3-1.4.4/ext/sqlite3
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/bin/ruby -I
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0 -r
       ./siteconf20220816-237-ohrf0o.rb extconf.rb
       checking for sqlite3.h... no
       sqlite3.h is missing. Try 'brew install sqlite3',
       'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
       and check your shared library search path (the
       location where your sqlite3 shared library is located).
       *** extconf.rb failed ***
       Could not create Makefile due to some reason, probably lack of necessary
       libraries and/or headers.  Check the mkmf.log file for more details.  You 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_dd10f8f7/vendor/ruby-3.1.2/bin/$(RUBY_BASE_NAME)
        --with-sqlcipher
        --without-sqlcipher
        --with-sqlite3-dir
        --without-sqlite3-dir
        --with-sqlite3-include
        --without-sqlite3-include=${sqlite3-dir}/include
        --with-sqlite3-lib
        --without-sqlite3-lib=${sqlite3-dir}/lib
        --with-sqlite3-config
        --without-sqlite3-config
        --with-pkg-config
        --without-pkg-config
        --with-sqlcipher
        --without-sqlcipher

       To see why this extension failed to compile, please check the mkmf.log which can
       be found here:

       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/sqlite3-1.4.4/mkmf.log

       extconf failed, exit code 1

       Gem files will remain installed in
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/sqlite3-1.4.4 for inspection.
       Results logged to
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/extensions/x86_64-linux/3.1.0/sqlite3-1.4.4/gem_make.out

       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:95:in
       `run'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:47:in
       `block in build'
         /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/tempfile.rb:317:in `open'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:26:in
       `build'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:161:in
       `build_extension'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:195:in
       `block in build_extensions'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
       `each'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/ext/builder.rb:192:in
       `build_extensions'
       /tmp/build_dd10f8f7/vendor/ruby-3.1.2/lib/ruby/3.1.0/rubygems/installer.rb:853:in
       `build_extensions'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/rubygems_gem_installer.rb:71:in
       `build_extensions'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/rubygems_gem_installer.rb:28:in
       `install'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/source/rubygems.rb:204:in
       `install'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/installer/gem_installer.rb:54:in
       `install'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/installer/gem_installer.rb:16:in
       `install_from_spec'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/installer/parallel_installer.rb:186:in
       `do_install'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/installer/parallel_installer.rb:177:in
       `block in worker_pool'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/worker.rb:62:in
       `apply_func'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/worker.rb:57:in
       `block in process_queue'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/worker.rb:54:in
       `loop'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/worker.rb:54:in
       `process_queue'
       /tmp/build_dd10f8f7/vendor/bundle/ruby/3.1.0/gems/bundler-2.3.10/lib/bundler/worker.rb:91:in
       `block (2 levels) in create_threads'

       An error occurred while installing sqlite3 (1.4.4), and Bundler cannot continue.

       In Gemfile:
         sqlite3
 !
 !     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.
 !     Push failed 
YvesCesar commented 2 years ago

O problema do deploy foi corrigido com a mudança para o PostgreSQL, entretanto, ainda preciso adaptar o projeto para o novo SGBD.

YvesCesar commented 2 years ago

Finalizo aqui a implementação da entrega contínua, o projeto já está adaptado ao PostgreSQL