rails初心者です。
HEROKUでrailsアプリのデプロイを試みているのですがエラーが出てしまいデプロイができません。
色々調べて試したのですが原因がわかりません。
出ているエラーは下記になります。
ruby
1git push heroku master 2 3Counting objects: 194, done. 4Delta compression using up to 4 threads. 5Compressing objects: 100% (172/172), done. 6Writing objects: 100% (194/194), 52.05 KiB | 2.74 MiB/s, done. 7Total 194 (delta 31), reused 0 (delta 0) 8remote: Compressing source files... done. 9remote: Building source: 10remote: 11remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used. 12remote: Detected buildpacks: Ruby,Node.js 13remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order 14remote: -----> Ruby app detected 15remote: -----> Compiling Ruby/Rails 16remote: -----> Using Ruby version: ruby-2.3.4 17remote: -----> Installing dependencies using bundler 1.15.2 18remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment 19remote: Your Gemfile lists the gem mysql2 (= 0.3.18) more than once. 20remote: You should probably keep only one of them. 21remote: While it's not a problem now, it could cause errors if you change the version of one of them later. 22remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. 23remote: Fetching gem metadata from https://rubygems.org/.......... 24remote: Fetching version metadata from https://rubygems.org/.. 25remote: Fetching dependency metadata from https://rubygems.org/. 26remote: The latest bundler is 1.16.0, but you are currently running 1.15.2. 27remote: To update, run `gem install bundler` 28remote: Could not find rack-test-0.7.1 in any of the sources 29remote: Bundler Output: Your Gemfile lists the gem mysql2 (= 0.3.18) more than once. 30remote: You should probably keep only one of them. 31remote: While it's not a problem now, it could cause errors if you change the version of one of them later. 32remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.0). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. 33remote: Fetching gem metadata from https://rubygems.org/.......... 34remote: Fetching version metadata from https://rubygems.org/.. 35remote: Fetching dependency metadata from https://rubygems.org/. 36remote: The latest bundler is 1.16.0, but you are currently running 1.15.2. 37remote: To update, run `gem install bundler` 38remote: Could not find rack-test-0.7.1 in any of the sources 39remote: ! 40remote: ! Failed to install gems via Bundler. 41remote: ! 42remote: ! Push rejected, failed to compile Ruby app. 43remote: 44remote: ! Push failed 45remote: Verifying deploy... 46remote: 47remote: ! Push rejected to cose-app. 48remote: 49To https://git.heroku.com/cose-app.git 50 ! [remote rejected] master -> master (pre-receive hook declined) 51error: failed to push some refs to 'https://git.heroku.com/cose-app.git' 52
ruby
1#gemfile 2 3source 'https://rubygems.org' 4 5git_source(:github) do |repo_name| 6 repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") 7 "https://github.com/#{repo_name}.git" 8end 9 10 11# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 12gem 'rails', '~> 5.1.4' 13# Use mysql as the database for Active Record 14gem 'mysql2', '0.3.18' 15# Use Puma as the app server 16gem 'puma', '~> 3.7' 17# Use SCSS for stylesheets 18gem 'sass-rails', '~> 5.0' 19# Use Uglifier as compressor for JavaScript assets 20gem 'uglifier', '>= 1.3.0' 21# See https://github.com/rails/execjs#readme for more supported runtimes 22# gem 'therubyracer', platforms: :ruby 23 24# Use CoffeeScript for .coffee assets and views 25gem 'coffee-rails', '~> 4.2' 26# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 27gem 'turbolinks', '~> 5' 28# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 29gem 'jbuilder', '~> 2.5' 30# Use Redis adapter to run Action Cable in production 31# gem 'redis', '~> 3.0' 32# Use ActiveModel has_secure_password 33# gem 'bcrypt', '~> 3.1.7' 34 35# Use Capistrano for deployment 36# gem 'capistrano-rails', group: :development 37 38group :development, :test do 39 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 40 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 41 # Adds support for Capybara system testing and selenium driver 42 gem 'capybara', '~> 2.13' 43 gem 'selenium-webdriver' 44end 45 46group :development do 47 # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. 48 gem 'web-console', '>= 3.3.0' 49 gem 'listen', '>= 3.0.5', '< 3.2' 50 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 51 gem 'spring' 52 gem 'spring-watcher-listen', '~> 2.0.0' 53end 54 55group :production do 56 gem 'rails_12factor' 57 gem 'mysql2', '0.3.18' 58end 59 60# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 61gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 62gem 'pry-rails' 63gem 'devise' 64gem 'enumerize' 65gem 'bootstrap-sass' 66gem 'jquery-rails' 67gem 'cancancan' 68gem 'rails_admin' 69gem "chartkick" 70gem 'ransack' 71gem 'momentjs-rails' 72gem 'bootstrap3-datetimepicker-rails' 73gem 'kaminari'
お詳しい方ご教授お願い致します。
以下追記
config/environments/production.rb
ruby
1 2Rails.application.configure do 3 # Settings specified here will take precedence over those in config/application.rb. 4 5 # Code is not reloaded between requests. 6 config.cache_classes = true 7 8 # Eager load code on boot. This eager loads most of Rails and 9 # your application in memory, allowing both threaded web servers 10 # and those relying on copy on write to perform better. 11 # Rake tasks automatically ignore this option for performance. 12 config.eager_load = true 13 14 # Full error reports are disabled and caching is turned on. 15 config.consider_all_requests_local = false 16 config.action_controller.perform_caching = true 17 18 # Attempt to read encrypted secrets from `config/secrets.yml.enc`. 19 # Requires an encryption key in `ENV["RAILS_MASTER_KEY"]` or 20 # `config/secrets.yml.key`. 21 config.read_encrypted_secrets = true 22 23 # Disable serving static files from the `/public` folder by default since 24 # Apache or NGINX already handles this. 25 config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? 26 27 # Compress JavaScripts and CSS. 28 config.assets.js_compressor = :uglifier 29 # config.assets.css_compressor = :sass 30 31 # Do not fallback to assets pipeline if a precompiled asset is missed. 32 config.assets.compile = true 33 34 # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb 35 36 # Enable serving of images, stylesheets, and JavaScripts from an asset server. 37 # config.action_controller.asset_host = 'http://assets.example.com' 38 39 # Specifies the header that your server uses for sending files. 40 # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache 41 # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX 42 43 # Mount Action Cable outside main process or domain 44 # config.action_cable.mount_path = nil 45 # config.action_cable.url = 'wss://example.com/cable' 46 # config.action_cable.allowed_request_origins = [ 'http://example.com', /http://example.*/ ] 47 48 # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. 49 # config.force_ssl = true 50 51 # Use the lowest log level to ensure availability of diagnostic information 52 # when problems arise. 53 config.log_level = :debug 54 55 # Prepend all log lines with the following tags. 56 config.log_tags = [ :request_id ] 57 58 # Use a different cache store in production. 59 # config.cache_store = :mem_cache_store 60 61 # Use a real queuing backend for Active Job (and separate queues per environment) 62 # config.active_job.queue_adapter = :resque 63 # config.active_job.queue_name_prefix = "cose_#{Rails.env}" 64 config.action_mailer.perform_caching = false 65 66 # Ignore bad email addresses and do not raise email delivery errors. 67 # Set this to true and configure the email server for immediate delivery to raise delivery errors. 68 # config.action_mailer.raise_delivery_errors = false 69 70 # Enable locale fallbacks for I18n (makes lookups for any locale fall back to 71 # the I18n.default_locale when a translation cannot be found). 72 config.i18n.fallbacks = true 73 74 # Send deprecation notices to registered listeners. 75 config.active_support.deprecation = :notify 76 77 # Use default logging formatter so that PID and timestamp are not suppressed. 78 config.log_formatter = ::Logger::Formatter.new 79 80 # Use a different logger for distributed setups. 81 # require 'syslog/logger' 82 # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') 83 84 if ENV["RAILS_LOG_TO_STDOUT"].present? 85 logger = ActiveSupport::Logger.new(STDOUT) 86 logger.formatter = config.log_formatter 87 config.logger = ActiveSupport::TaggedLogging.new(logger) 88 end 89 90 # Do not dump schema after migrations. 91 config.active_record.dump_schema_after_migration = false 92end 93

回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。