75639
Gemfileです。

```

    source 'https://rubygems.org'
    git_source(:github) { |repo| "https://github.com/#{repo}.git" }
    
    ruby '2.6.5'
    
    # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
    gem 'rails', '~> 6.0.0'
    # Use mysql as the database for Active Record
    gem 'mysql2', '0.5.3'
    # Use Puma as the app server
    gem 'puma', '~> 3.11'
    # Use SCSS for stylesheets
    gem 'sass-rails', '~> 5'
    # Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
    gem 'webpacker', '~> 4.0'
    # 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.7'
    # Use Redis adapter to run Action Cable in production
    # gem 'redis', '~> 4.0'
    # Use Active Model has_secure_password
    # gem 'bcrypt', '~> 3.1.7'
    
    # Use Active Storage variant
    # gem 'image_processing', '~> 1.2'
    
    # Reduces boot times through caching; required in config/boot.rb
    gem 'bootsnap', '>= 1.4.2', require: false
    
    group :development, :test do
      # Call 'byebug' anywhere in the code to stop execution and get a debugger console
      gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
      gem 'pry-rails' 
      gem 'factory_bot_rails'
      gem 'faker'
      gem 'rspec-rails', '~> 4.0.0'
    end
    
    group :development do
      # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
      gem 'web-console', '>= 3.3.0'
      gem 'listen', '>= 3.0.5', '< 3.2'
      # 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'
      gem 'rubocop', require: false
    end
    
    
    
    group :test do
      # Adds support for Capybara system testing and selenium driver
      gem 'capybara', '>= 2.15'
      gem 'selenium-webdriver'
      # Easy installation and use of web drivers to run system tests with browsers
      gem 'webdrivers'
    end
    
    # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
    gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
    gem 'devise'
    gem 'active_hash'
    gem 'mini_magick'
    gem 'image_processing', '~> 1.2'
    gem 'mini_racer'
    
```

Gemfile.lockです。

```

    GEM
      remote: https://rubygems.org/
      specs:
        actioncable (6.0.3.7)
          actionpack (= 6.0.3.7)
          nio4r (~> 2.0)
          websocket-driver (>= 0.6.1)
        actionmailbox (6.0.3.7)
          actionpack (= 6.0.3.7)
          activejob (= 6.0.3.7)
          activerecord (= 6.0.3.7)
          activestorage (= 6.0.3.7)
          activesupport (= 6.0.3.7)
          mail (>= 2.7.1)
        actionmailer (6.0.3.7)
          actionpack (= 6.0.3.7)
          actionview (= 6.0.3.7)
          activejob (= 6.0.3.7)
          mail (~> 2.5, >= 2.5.4)
          rails-dom-testing (~> 2.0)
        actionpack (6.0.3.7)
          actionview (= 6.0.3.7)
          activesupport (= 6.0.3.7)
          rack (~> 2.0, >= 2.0.8)
          rack-test (>= 0.6.3)
          rails-dom-testing (~> 2.0)
          rails-html-sanitizer (~> 1.0, >= 1.2.0)
        actiontext (6.0.3.7)
          actionpack (= 6.0.3.7)
          activerecord (= 6.0.3.7)
          activestorage (= 6.0.3.7)
          activesupport (= 6.0.3.7)
          nokogiri (>= 1.8.5)
        actionview (6.0.3.7)
          activesupport (= 6.0.3.7)
          builder (~> 3.1)
          erubi (~> 1.4)
          rails-dom-testing (~> 2.0)
          rails-html-sanitizer (~> 1.1, >= 1.2.0)
        active_hash (3.1.0)
          activesupport (>= 5.0.0)
        activejob (6.0.3.7)
          activesupport (= 6.0.3.7)
          globalid (>= 0.3.6)
        activemodel (6.0.3.7)
          activesupport (= 6.0.3.7)
        activerecord (6.0.3.7)
          activemodel (= 6.0.3.7)
          activesupport (= 6.0.3.7)
        activestorage (6.0.3.7)
          actionpack (= 6.0.3.7)
          activejob (= 6.0.3.7)
          activerecord (= 6.0.3.7)
          marcel (~> 1.0.0)
        activesupport (6.0.3.7)
          concurrent-ruby (~> 1.0, >= 1.0.2)
          i18n (>= 0.7, < 2)
          minitest (~> 5.1)
          tzinfo (~> 1.1)
          zeitwerk (~> 2.2, >= 2.2.2)
        addressable (2.7.0)
          public_suffix (>= 2.0.2, < 5.0)
        ast (2.4.2)
        bcrypt (3.1.16)
        bindex (0.8.1)
        bootsnap (1.7.5)
          msgpack (~> 1.0)
        builder (3.2.4)
        byebug (11.1.3)
        capybara (3.35.3)
          addressable
          mini_mime (>= 0.1.3)
          nokogiri (~> 1.8)
          rack (>= 1.6.0)
          rack-test (>= 0.6.3)
          regexp_parser (>= 1.5, < 3.0)
          xpath (~> 3.2)
        childprocess (3.0.0)
        coderay (1.1.3)
        concurrent-ruby (1.1.8)
        crass (1.0.6)
        devise (4.8.0)
          bcrypt (~> 3.0)
          orm_adapter (~> 0.1)
          railties (>= 4.1.0)
          responders
          warden (~> 1.2.3)
        diff-lcs (1.4.4)
        erubi (1.10.0)
        factory_bot (6.1.0)
          activesupport (>= 5.0.0)
        factory_bot_rails (6.1.0)
          factory_bot (~> 6.1.0)
          railties (>= 5.0.0)
        faker (2.17.0)
          i18n (>= 1.6, < 2)
        ffi (1.15.0)
        globalid (0.4.2)
          activesupport (>= 4.2.0)
        i18n (1.8.10)
          concurrent-ruby (~> 1.0)
        image_processing (1.12.1)
          mini_magick (>= 4.9.5, < 5)
          ruby-vips (>= 2.0.17, < 3)
        jbuilder (2.11.2)
          activesupport (>= 5.0.0)
        libv8-node (15.14.0.1)
        listen (3.1.5)
          rb-fsevent (~> 0.9, >= 0.9.4)
          rb-inotify (~> 0.9, >= 0.9.7)
          ruby_dep (~> 1.2)
        loofah (2.9.1)
          crass (~> 1.0.2)
          nokogiri (>= 1.5.9)
        mail (2.7.1)
          mini_mime (>= 0.1.1)
        marcel (1.0.1)
        method_source (1.0.0)
        mini_magick (4.11.0)
        mini_mime (1.1.0)
        mini_portile2 (2.5.1)
        mini_racer (0.4.0)
          libv8-node (~> 15.14.0.0)
        minitest (5.14.4)
        msgpack (1.4.2)
        mysql2 (0.5.3)
        nio4r (2.5.7)
        nokogiri (1.11.3)
          mini_portile2 (~> 2.5.0)
          racc (~> 1.4)
        orm_adapter (0.5.0)
        parallel (1.20.1)
        parser (3.0.1.1)
          ast (~> 2.4.1)
        pry (0.14.1)
          coderay (~> 1.1)
          method_source (~> 1.0)
        pry-rails (0.3.9)
          pry (>= 0.10.4)
        public_suffix (4.0.6)
        puma (3.12.6)
        racc (1.5.2)
        rack (2.2.3)
        rack-proxy (0.6.5)
          rack
        rack-test (1.1.0)
          rack (>= 1.0, < 3)
        rails (6.0.3.7)
          actioncable (= 6.0.3.7)
          actionmailbox (= 6.0.3.7)
          actionmailer (= 6.0.3.7)
          actionpack (= 6.0.3.7)
          actiontext (= 6.0.3.7)
          actionview (= 6.0.3.7)
          activejob (= 6.0.3.7)
          activemodel (= 6.0.3.7)
          activerecord (= 6.0.3.7)
          activestorage (= 6.0.3.7)
          activesupport (= 6.0.3.7)
          bundler (>= 1.3.0)
          railties (= 6.0.3.7)
          sprockets-rails (>= 2.0.0)
        rails-dom-testing (2.0.3)
          activesupport (>= 4.2.0)
          nokogiri (>= 1.6)
        rails-html-sanitizer (1.3.0)
          loofah (~> 2.3)
        railties (6.0.3.7)
          actionpack (= 6.0.3.7)
          activesupport (= 6.0.3.7)
          method_source
          rake (>= 0.8.7)
          thor (>= 0.20.3, < 2.0)
        rainbow (3.0.0)
        rake (13.0.3)
        rb-fsevent (0.10.4)
        rb-inotify (0.10.1)
          ffi (~> 1.0)
        regexp_parser (2.1.1)
        responders (3.0.1)
          actionpack (>= 5.0)
          railties (>= 5.0)
        rexml (3.2.5)
        rspec-core (3.10.1)
          rspec-support (~> 3.10.0)
        rspec-expectations (3.10.1)
          diff-lcs (>= 1.2.0, < 2.0)
          rspec-support (~> 3.10.0)
        rspec-mocks (3.10.2)
          diff-lcs (>= 1.2.0, < 2.0)
          rspec-support (~> 3.10.0)
        rspec-rails (4.0.2)
          actionpack (>= 4.2)
          activesupport (>= 4.2)
          railties (>= 4.2)
          rspec-core (~> 3.10)
          rspec-expectations (~> 3.10)
          rspec-mocks (~> 3.10)
          rspec-support (~> 3.10)
        rspec-support (3.10.2)
        rubocop (1.14.0)
          parallel (~> 1.10)
          parser (>= 3.0.0.0)
          rainbow (>= 2.2.2, < 4.0)
          regexp_parser (>= 1.8, < 3.0)
          rexml
          rubocop-ast (>= 1.5.0, < 2.0)
          ruby-progressbar (~> 1.7)
          unicode-display_width (>= 1.4.0, < 3.0)
        rubocop-ast (1.5.0)
          parser (>= 3.0.1.1)
        ruby-progressbar (1.11.0)
        ruby-vips (2.1.0)
          ffi (~> 1.12)
        ruby_dep (1.5.0)
        rubyzip (2.3.0)
        sass (3.7.4)
          sass-listen (~> 4.0.0)
        sass-listen (4.0.0)
          rb-fsevent (~> 0.9, >= 0.9.4)
          rb-inotify (~> 0.9, >= 0.9.7)
        sass-rails (5.1.0)
          railties (>= 5.2.0)
          sass (~> 3.1)
          sprockets (>= 2.8, < 4.0)
          sprockets-rails (>= 2.0, < 4.0)
          tilt (>= 1.1, < 3)
        selenium-webdriver (3.142.7)
          childprocess (>= 0.5, < 4.0)
          rubyzip (>= 1.2.2)
        spring (2.1.1)
        spring-watcher-listen (2.0.1)
          listen (>= 2.7, < 4.0)
          spring (>= 1.2, < 3.0)
        sprockets (3.7.2)
          concurrent-ruby (~> 1.0)
          rack (> 1, < 3)
        sprockets-rails (3.2.2)
          actionpack (>= 4.0)
          activesupport (>= 4.0)
          sprockets (>= 3.0.0)
        thor (1.1.0)
        thread_safe (0.3.6)
        tilt (2.0.10)
        turbolinks (5.2.1)
          turbolinks-source (~> 5.2)
        turbolinks-source (5.2.0)
        tzinfo (1.2.9)
          thread_safe (~> 0.1)
        unicode-display_width (2.0.0)
        warden (1.2.9)
          rack (>= 2.0.9)
        web-console (4.1.0)
          actionview (>= 6.0.0)
          activemodel (>= 6.0.0)
          bindex (>= 0.4.0)
          railties (>= 6.0.0)
        webdrivers (4.6.0)
          nokogiri (~> 1.6)
          rubyzip (>= 1.3.0)
          selenium-webdriver (>= 3.0, < 4.0)
        webpacker (4.3.0)
          activesupport (>= 4.2)
          rack-proxy (>= 0.6.1)
          railties (>= 4.2)
        websocket-driver (0.7.3)
          websocket-extensions (>= 0.1.0)
        websocket-extensions (0.1.5)
        xpath (3.2.0)
          nokogiri (~> 1.8)
        zeitwerk (2.4.2)
    
    PLATFORMS
      ruby
    
    DEPENDENCIES
      active_hash
      bootsnap (>= 1.4.2)
      byebug
      capybara (>= 2.15)
      devise
      factory_bot_rails
      faker
      image_processing (~> 1.2)
      jbuilder (~> 2.7)
      listen (>= 3.0.5, < 3.2)
      mini_magick
      mini_racer
      mysql2 (= 0.5.3)
      pry-rails
      puma (~> 3.11)
      rails (~> 6.0.0)
      rspec-rails (~> 4.0.0)
      rubocop
      sass-rails (~> 5)
      selenium-webdriver
      spring
      spring-watcher-listen (~> 2.0.0)
      turbolinks (~> 5)
      tzinfo-data
      web-console (>= 3.3.0)
      webdrivers
      webpacker (~> 4.0)
    
    RUBY VERSION
       ruby 2.6.5p114
    
    BUNDLED WITH
       2.1.4
    
    
```

heroku logs --tail --app実行結果です。

```

    2021-05-06T09:19:09.501879+00:00 app[api]: Starting process with command `rails db:migrate` by user メールアドレス
    2021-05-06T09:19:10.269368+00:00 heroku[run.2155]: State changed from starting to up
    2021-05-06T09:19:10.803157+00:00 heroku[run.2155]: Awaiting client
    2021-05-06T09:19:12.453814+00:00 heroku[run.2155]: Starting process with command `rails db:migrate`
    2021-05-06T09:19:17.701679+00:00 heroku[run.2155]: Process exited with status 127
    2021-05-06T09:19:17.914072+00:00 heroku[run.2155]: State changed from up to complete
    2021-05-06T09:19:41.000000+00:00 app[api]: Build started by user メールアドレス
    2021-05-06T09:19:45.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f8a5ac35-99b5-42f1-8f75-98f7a258e760/activity/builds/0e604b70-5f55-45f0-a4d5-f6f0824bcd75
    2021-05-06T09:45:01.427080+00:00 app[api]: Set DATABASE_URL config vars by user メールアドレス
    2021-05-06T09:45:01.427080+00:00 app[api]: Release v8 created by user メールアドレス
    2021-05-06T09:46:08.000000+00:00 app[api]: Build started by user メールアドレス
    2021-05-06T09:46:12.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f8a5ac35-99b5-42f1-8f75-98f7a258e760/activity/builds/f91048c3-0fd4-4794-9c3d-1822f912dc87
    2021-05-06T10:19:05.000000+00:00 app[api]: Build started by user メールアドレス
    2021-05-06T10:19:09.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/f8a5ac35-99b5-42f1-8f75-98f7a258e760/activity/builds/3acd51aa-38ac-43d9-904c-7f182550d09a
    
    
```

git push heroku master 実行結果です

```

    Enumerating objects: 631, done.
    Counting objects: 100% (631/631), done.
    Delta compression using up to 8 threads
    Compressing objects: 100% (597/597), done.
    Writing objects: 100% (631/631), 9.69 MiB | 2.47 MiB/s, done.
    Total 631 (delta 308), reused 0 (delta 0)
    remote: Compressing source files... done.
    remote: Building source:
    remote: 
    remote: -----> Building on the Heroku-18 stack
    remote: -----> Determining which buildpack to use for this app
    remote:  !     Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
    remote:                         Detected buildpacks: Ruby,Node.js
    remote:                         See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
    remote: -----> Ruby app detected
    remote: -----> Installing bundler 2.2.16
    remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
    remote: -----> Compiling Ruby/Rails
    remote: -----> Using Ruby version: ruby-2.6.5
    remote: -----> Installing dependencies using bundler 2.2.16
    remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
    remote:        Your bundle only supports platforms ["x86_64-darwin-20"] but your local platform
    remote:        is x86_64-linux. Add the current platform to the lockfile with `bundle lock
    remote:        --add-platform x86_64-linux` and try again.
    remote:        Bundler Output: Your bundle only supports platforms ["x86_64-darwin-20"] but your local platform
    remote:        is x86_64-linux. Add the current platform to the lockfile with `bundle lock
    remote:        --add-platform x86_64-linux` and try again.
    remote: 
    remote:  !
    remote:  !     Failed to install gems via Bundler.
    remote:  !
    remote:  !     Push rejected, failed to compile Ruby app.
    remote: 
    remote:  !     Push failed
    remote:  !
    remote:  ! ## Warning - The same version of this code has already been built: 8ec4daa2b239133614e9458a901765d37cb4549c
    remote:  !
    remote:  ! We have detected that you have triggered a build from source code with version 8ec4daa2b239133614e9458a901765d37cb4549c
    remote:  ! at least twice. One common cause of this behavior is attempting to deploy code from a different branch.
    remote:  !
    remote:  ! If you are developing on a branch and deploying via git you must run:
    remote:  !
    remote:  !     git push heroku <branchname>:main
    remote:  !
    remote:  ! This article goes into details on the behavior:
    remote:  !   https://devcenter.heroku.com/articles/duplicate-build-version
    remote: 
    remote: Verifying deploy...
    remote: 
    remote: !       Push rejected to アプリ名.
    remote: 
    To https://git.heroku.com/アプリ名.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'https://git.heroku.com/アプリ名.git'
    
```

Rubyをインストールしたがバージョンが変わらないとのことなのでvim ~/.zshrcのインサートモードで  
export PATH="~/.rbenv/shims:/usr/local/bin:$PATH"を追加しました。  
その結果ruby -vをしたらrailsのバージョンが無事切り替わってました。  
でもエラーがまだ変わりませんでした。

```

    ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-darwin20]
    
```

もう一週間以上解決できずにいます、どなたかお願いします。
CC BY-SA 4.0
2021-05-02T17:08:20.033
75637
2021-05-06T10:55:17.943
2021-05-06T10:55:17.943
45049
45049
question
ruby-on-rails ruby git heroku
git push heroku masterでherokuにデプロイできない
```

    Detected sqlite3 gem which is not supported on Heroku:
    https://devcenter.heroku.com/articles/sqlite3
    
```

こちらの2行に説明があります。`sqlite3`はHerokuではサポートされていないとのことです。  
`Gemfile`にある`sqlite3`の行を`development`グループに入れれば解決すると思われます。

Herokuの詳細な利用方法については[こちら](https://devcenter.heroku.com/ja/articles/getting-
started-with-rails6)を参照してください。
CC BY-SA 4.0
2021-05-03T01:53:13.677
75639
2021-05-06T03:56:30.193
2021-05-06T03:56:30.193
442
442
75637
answer