Skip to content

Instantly share code, notes, and snippets.

@gam0022
Created December 9, 2014 12:59
Show Gist options
  • Save gam0022/5af6952d56518ae1227e to your computer and use it in GitHub Desktop.
Save gam0022/5af6952d56518ae1227e to your computer and use it in GitHub Desktop.
Rails4のアプリをHerokuで動かす ref: http://qiita.com/gam0022/items/e9e0fe3e195035873462
timeout: 5000
production:
- adapter: sqlite3
- database: db/production.sqlite3
+ adapter: pg
+ database: db/production.pg
Gem files will remain installed in /tmp/build_8njhwta846es/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8 for inspection.
Results logged to /tmp/build_8njhwta846es/vendor/bundle/ruby/2.0.0/gems/sqlite3-1.3.8/ext/sqlite3/gem_make.out
An error occurred while installing sqlite3 (1.3.8), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.8'` succeeds before bundling.
!
! 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/Rails app
To [email protected]:pacific-waters-7608.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:pacific-waters-7608.git'
git init
git add .
git commit -m "first commit"
heroku create # このとき、`heroku create アプリ名` で、任意のアプリ名にもできる。
git push heroku # Heroku への deploy は git の commit で行うよう。時間がかかる。
heroku open # ブラウザで確認できる。
git push heroku
! No such app as pacific-waters-7608.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
heroku run rake db:migrate
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
-gem 'sqlite3'
+gem 'sqlite3', groups: %w(test development), require: false
+gem 'pg', groups: %w(production), require: false
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
- config.serve_static_assets = false
+ config.serve_static_assets = true
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment