diff --git a/Gemfile b/Gemfile index 1eb3f23f..9d3d0d19 100644 --- a/Gemfile +++ b/Gemfile @@ -1,4 +1,5 @@ source "https://rubygems.org" +ruby "2.5.0" git_source(:github) do |repo_name| repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") @@ -9,7 +10,8 @@ group :production, :development, :test do # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem "rails", "~> 5.1.5", require: false # Use sqlite3 as the database for Active Record - gem "sqlite3", require: false + # sqlite is disabled here because we want to use it only for development. + # gem "sqlite3", require: false # Use Puma as the app server gem "puma", "~> 3.7", require: false # Use SCSS for stylesheets @@ -38,10 +40,19 @@ group :production, :development, :test do ############################## gem "activeadmin" + gem "colorize" gem "devise" gem "haml" end +group :production do + ############################## + # Place all added gems below # + ############################## + + gem "pg" +end + 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] @@ -54,12 +65,12 @@ group :development, :test do ############################## gem "awesome_print", require: true - gem "colorize", require: false gem "cucumber", require: false gem "cucumber_lint", require: false gem "pry-nav", require: true gem "pry-rails", require: true gem "rubocop", require: false + gem "sqlite3", require: false end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index 50ef549a..3c21f15b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -188,6 +188,7 @@ GEM parallel (1.12.1) parser (2.5.0.5) ast (~> 2.4.0) + pg (1.0.0) polyamorous (1.3.3) activerecord (>= 3.0) powerpack (0.1.1) @@ -201,7 +202,7 @@ GEM pry (>= 0.10.4) public_suffix (3.0.2) puma (3.11.3) - rack (2.0.4) + rack (2.0.5) rack-test (0.8.3) rack (>= 1.0, < 3) rails (5.1.5) @@ -278,7 +279,7 @@ GEM actionpack (> 4, < 5.2) activemodel (> 4, < 5.2) slop (3.6.0) - sprockets (3.7.1) + sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) @@ -333,6 +334,7 @@ DEPENDENCIES jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) mdl + pg pry-nav pry-rails puma (~> 3.7) @@ -348,5 +350,8 @@ DEPENDENCIES uglifier (>= 1.3.0) web-console (>= 3.3.0) +RUBY VERSION + ruby 2.5.0p0 + BUNDLED WITH 1.16.1 diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..a210c6d5 --- /dev/null +++ b/Procfile @@ -0,0 +1,4 @@ +# https://devcenter.heroku.com/articles/getting-started-with-rails5#webserver +web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} +# https://mentalized.net/journal/2017/04/22/run-rails-migrations-on-heroku-deploy/ +release: bundle exec rake db:migrate diff --git a/config/database.yml b/config/database.yml index 0d02f249..b6102620 100644 --- a/config/database.yml +++ b/config/database.yml @@ -21,5 +21,5 @@ test: database: db/test.sqlite3 production: - <<: *default - database: db/production.sqlite3 + url: <%= ENV["DATABASE_URL"] %> + pool: <%= ENV["DB_POOL"] || ENV['RAILS_MAX_THREADS'] || 5 %>