今回はHerokuを使ってみようの会ですw
今回の参考先もmacを買って、今すぐherokuでruby1.9.3 + rails3.2しよう!ですww
ありがとうございますm(__)m
Herokuの登録は
macを買って、今すぐherokuでruby1.9.3 + rails3.2しよう!
の『herokuアカウントを作成』から読んでね。
アカウントが作成出来たら、参考先をそのまま続けてやってきましょうー。
ssh公開鍵を作成する
以下コマンドを打って、Enterを押すと出来上がり。
$ ssh-keygen -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/xxxx/.ssh/id_rsa): ←Enter押す
Created directory '/Users/xxxx/.ssh'.
Enter passphrase (empty for no passphrase): ←入力せずにEnter押す
Enter same passphrase again: ←入力せずEnter押す
Your identification has been saved in /Users/xxxx/.ssh/id_rsa.
Your public key has been saved in /Users/xxxx/.ssh/id_rsa.pub.
fingerprintとか表示されるので、眺めて終了。
作った公開鍵を登録
作った公開鍵を登録
heroku keys:add
rvm gemsetを作成する
rvm gemsetってなんじゃらホイと思ってぐぐってみました。
RVM gemset とは?によると、rubyのバージョンと使用用途によってgemの組み合わせやバージョンを管理できるようになる仕組みのようです。
開発環境によって、組み合わせが変わったりできるとか。
次のサイトで、賢い使い方がわかりやすく載ってたので、使う場合は参考にすると良いかと。(参考サイト:rvm のgemsetをおさらい(Mac でRuby))
とりあえず、heroku用のgemsetを作って見ましょうー。
以下のコマンドでOK。
rvm --create 1.9.3-p194@heroku-samplegemでherokuをインストールもしちゃいます。
$ gem install heroku --no-ri --no-rdoc
Fetching: excon-0.16.2.gem (100%)
Fetching: heroku-api-0.3.5.gem (100%)
Fetching: netrc-0.7.7.gem (100%)
Fetching: mime-types-1.19.gem (100%)
Fetching: rest-client-1.6.7.gem (100%)
Fetching: addressable-2.3.2.gem (100%)
Fetching: launchy-2.1.2.gem (100%)
Fetching: rubyzip-0.9.9.gem (100%)
Fetching: heroku-2.31.2.gem (100%)
! Heroku recommends using the Heroku Toolbelt to install the CLI.
! Download it from: https://toolbelt.heroku.com
Successfully installed excon-0.16.2
Successfully installed heroku-api-0.3.5
Successfully installed netrc-0.7.7
Successfully installed mime-types-1.19
Successfully installed rest-client-1.6.7
Successfully installed addressable-2.3.2
Successfully installed launchy-2.1.2
Successfully installed rubyzip-0.9.9
Successfully installed heroku-2.31.2
9 gems installed
Herokuにログインする
herokuにログインします。heroku login
herokuアカウントのメアドとパスワードを入力して
Authentication successful. って言われたらOK。
rails3.2.2をインストール
railsをインストールします。2012/09/17時点で、railsの最新が3.2.8だったので、それを入れてみます。
gem install rails --version 3.2.8 --no-ri --no-rdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem install rails --version 3.2.8 --no-ri --no-rdoc | |
Fetching: i18n-0.6.1.gem (100%) | |
Fetching: multi_json-1.3.6.gem (100%) | |
Fetching: activesupport-3.2.8.gem (100%) | |
Fetching: builder-3.0.3.gem (100%) | |
Fetching: activemodel-3.2.8.gem (100%) | |
Fetching: rack-1.4.1.gem (100%) | |
Fetching: rack-cache-1.2.gem (100%) | |
Fetching: rack-test-0.6.1.gem (100%) | |
Fetching: journey-1.0.4.gem (100%) | |
Fetching: hike-1.2.1.gem (100%) | |
Fetching: tilt-1.3.3.gem (100%) | |
Fetching: sprockets-2.1.3.gem (100%) | |
Fetching: erubis-2.7.0.gem (100%) | |
Fetching: actionpack-3.2.8.gem (100%) | |
Fetching: arel-3.0.2.gem (100%) | |
Fetching: tzinfo-0.3.33.gem (100%) | |
Fetching: activerecord-3.2.8.gem (100%) | |
Fetching: activeresource-3.2.8.gem (100%) | |
Fetching: polyglot-0.3.3.gem (100%) | |
Fetching: treetop-1.4.10.gem (100%) | |
Fetching: mail-2.4.4.gem (100%) | |
Fetching: actionmailer-3.2.8.gem (100%) | |
Fetching: rack-ssl-1.3.2.gem (100%) | |
Fetching: thor-0.16.0.gem (100%) | |
Fetching: json-1.7.5.gem (100%) | |
Building native extensions. This could take a while... | |
Fetching: rdoc-3.12.gem (100%) | |
Depending on your version of ruby, you may need to install ruby rdoc/ri data: | |
<= 1.8.6 : unsupported | |
= 1.8.7 : gem install rdoc-data; rdoc-data --install | |
= 1.9.1 : gem install rdoc-data; rdoc-data --install | |
>= 1.9.2 : nothing to do! Yay! | |
Fetching: railties-3.2.8.gem (100%) | |
Fetching: rails-3.2.8.gem (100%) | |
Successfully installed i18n-0.6.1 | |
Successfully installed multi_json-1.3.6 | |
Successfully installed activesupport-3.2.8 | |
Successfully installed builder-3.0.3 | |
Successfully installed activemodel-3.2.8 | |
Successfully installed rack-1.4.1 | |
Successfully installed rack-cache-1.2 | |
Successfully installed rack-test-0.6.1 | |
Successfully installed journey-1.0.4 | |
Successfully installed hike-1.2.1 | |
Successfully installed tilt-1.3.3 | |
Successfully installed sprockets-2.1.3 | |
Successfully installed erubis-2.7.0 | |
Successfully installed actionpack-3.2.8 | |
Successfully installed arel-3.0.2 | |
Successfully installed tzinfo-0.3.33 | |
Successfully installed activerecord-3.2.8 | |
Successfully installed activeresource-3.2.8 | |
Successfully installed polyglot-0.3.3 | |
Successfully installed treetop-1.4.10 | |
Successfully installed mail-2.4.4 | |
Successfully installed actionmailer-3.2.8 | |
Successfully installed rack-ssl-1.3.2 | |
Successfully installed thor-0.16.0 | |
Successfully installed json-1.7.5 | |
Successfully installed rdoc-3.12 | |
Successfully installed railties-3.2.8 | |
Successfully installed rails-3.2.8 | |
28 gems installed |
アプリを作成する
railsアプリをまず作ります。rails new heroku-sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rails new heroku-sample | |
create | |
create README.rdoc | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/assets/images/rails.png | |
create app/assets/javascripts/application.js | |
create app/assets/stylesheets/application.css | |
create app/controllers/application_controller.rb | |
create app/helpers/application_helper.rb | |
create app/mailers | |
create app/models | |
create app/views/layouts/application.html.erb | |
create app/mailers/.gitkeep | |
create app/models/.gitkeep | |
create config | |
create config/routes.rb | |
create config/application.rb | |
create config/environment.rb | |
create config/environments | |
create config/environments/development.rb | |
create config/environments/production.rb | |
create config/environments/test.rb | |
create config/initializers | |
create config/initializers/backtrace_silencers.rb | |
create config/initializers/inflections.rb | |
create config/initializers/mime_types.rb | |
create config/initializers/secret_token.rb | |
create config/initializers/session_store.rb | |
create config/initializers/wrap_parameters.rb | |
create config/locales | |
create config/locales/en.yml | |
create config/boot.rb | |
create config/database.yml | |
create db | |
create db/seeds.rb | |
create doc | |
create doc/README_FOR_APP | |
create lib | |
create lib/tasks | |
create lib/tasks/.gitkeep | |
create lib/assets | |
create lib/assets/.gitkeep | |
create log | |
create log/.gitkeep | |
create public | |
create public/404.html | |
create public/422.html | |
create public/500.html | |
create public/favicon.ico | |
create public/index.html | |
create public/robots.txt | |
create script | |
create script/rails | |
create test/fixtures | |
create test/fixtures/.gitkeep | |
create test/functional | |
create test/functional/.gitkeep | |
create test/integration | |
create test/integration/.gitkeep | |
create test/unit | |
create test/unit/.gitkeep | |
create test/performance/browsing_test.rb | |
create test/test_helper.rb | |
create tmp/cache | |
create tmp/cache/assets | |
create vendor/assets/javascripts | |
create vendor/assets/javascripts/.gitkeep | |
create vendor/assets/stylesheets | |
create vendor/assets/stylesheets/.gitkeep | |
create vendor/plugins | |
create vendor/plugins/.gitkeep | |
run bundle install | |
Fetching gem metadata from https://rubygems.org/......... | |
Using rake (0.9.2.2) | |
Using i18n (0.6.1) | |
Using multi_json (1.3.6) | |
Using activesupport (3.2.8) | |
Using builder (3.0.3) | |
Using activemodel (3.2.8) | |
Using erubis (2.7.0) | |
Using journey (1.0.4) | |
Using rack (1.4.1) | |
Using rack-cache (1.2) | |
Using rack-test (0.6.1) | |
Using hike (1.2.1) | |
Using tilt (1.3.3) | |
Using sprockets (2.1.3) | |
Using actionpack (3.2.8) | |
Using mime-types (1.19) | |
Using polyglot (0.3.3) | |
Using treetop (1.4.10) | |
Using mail (2.4.4) | |
Using actionmailer (3.2.8) | |
Using arel (3.0.2) | |
Using tzinfo (0.3.33) | |
Using activerecord (3.2.8) | |
Using activeresource (3.2.8) | |
Using bundler (1.2.0) | |
Installing coffee-script-source (1.3.3) | |
Installing execjs (1.4.0) | |
Installing coffee-script (2.2.0) | |
Using rack-ssl (1.3.2) | |
Using json (1.7.5) | |
Using rdoc (3.12) | |
Using thor (0.16.0) | |
Using railties (3.2.8) | |
Installing coffee-rails (3.2.2) | |
Installing jquery-rails (2.1.2) | |
Using rails (3.2.8) | |
Installing sass (3.2.1) | |
Installing sass-rails (3.2.5) | |
Installing sqlite3 (1.3.6) with native extensions | |
Installing uglifier (1.3.0) | |
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. |
が、ここではデフォルトでいきますw
次に、サンプルアプリの中のディレクトリに移動します。
cd heroku-samplegitを初期化します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git init | |
Initialized empty Git repository in /Users/yukiko/Documents/heroku-sample/.git/ | |
$ git add -A | |
$ git commit -m'init' | |
[master (root-commit) 1a20ea1] init | |
37 files changed, 1204 insertions(+) | |
create mode 100644 .gitignore | |
create mode 100644 Gemfile | |
create mode 100644 Gemfile.lock | |
create mode 100644 README.rdoc | |
create mode 100644 Rakefile | |
create mode 100644 app/assets/images/rails.png | |
create mode 100644 app/assets/javascripts/application.js | |
create mode 100644 app/assets/stylesheets/application.css | |
create mode 100644 app/controllers/application_controller.rb | |
create mode 100644 app/helpers/application_helper.rb | |
create mode 100644 app/mailers/.gitkeep | |
create mode 100644 app/models/.gitkeep | |
create mode 100644 app/views/layouts/application.html.erb | |
create mode 100644 config.ru | |
create mode 100644 config/application.rb | |
create mode 100644 config/boot.rb | |
create mode 100644 config/database.yml | |
create mode 100644 config/environment.rb | |
create mode 100644 config/environments/development.rb | |
create mode 100644 config/environments/production.rb | |
create mode 100644 config/environments/test.rb | |
create mode 100644 config/initializers/backtrace_silencers.rb | |
create mode 100644 config/initializers/inflections.rb | |
create mode 100644 config/initializers/mime_types.rb | |
create mode 100644 config/initializers/secret_token.rb | |
create mode 100644 config/initializers/session_store.rb | |
create mode 100644 config/initializers/wrap_parameters.rb | |
create mode 100644 config/locales/en.yml | |
create mode 100644 config/routes.rb | |
create mode 100644 db/seeds.rb | |
create mode 100644 doc/README_FOR_APP | |
create mode 100644 lib/assets/.gitkeep | |
create mode 100644 lib/tasks/.gitkeep | |
create mode 100644 log/.gitkeep | |
create mode 100644 public/404.html | |
create mode 100644 public/422.html | |
create mode 100644 public/500.html | |
create mode 100644 public/favicon.ico | |
create mode 100644 public/index.html | |
create mode 100644 public/robots.txt | |
create mode 100755 script/rails | |
create mode 100644 test/fixtures/.gitkeep | |
create mode 100644 test/functional/.gitkeep | |
create mode 100644 test/integration/.gitkeep | |
create mode 100644 test/performance/browsing_test.rb | |
create mode 100644 test/test_helper.rb | |
create mode 100644 test/unit/.gitkeep | |
create mode 100644 vendor/assets/javascripts/.gitkeep | |
create mode 100644 vendor/assets/stylesheets/.gitkeep | |
create mode 100644 vendor/plugins/.gitkeep |
次に、最低限のgemを記述します。(といってもコンソールでコマンド叩くだけ)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl https://raw.github.com/gist/1970532/376b6a26ed936ac43cad0b17a64512f5c0216a50/Gemifile > Gemfile | |
% Total % Received % Xferd Average Speed Time Time Time Current | |
Dload Upload Total Spent Left Speed | |
100 302 100 302 0 0 83 0 0:00:03 0:00:03 --:--:-- 109 | |
$ rm -f Gemfile.lock | |
$ bundle install --without production | |
Fetching gem metadata from https://rubygems.org/......... | |
Using rake (0.9.2.2) | |
Using i18n (0.6.1) | |
Using multi_json (1.3.6) | |
Installing activesupport (3.2.2) | |
Using builder (3.0.3) | |
Installing activemodel (3.2.2) | |
Using erubis (2.7.0) | |
Using journey (1.0.4) | |
Using rack (1.4.1) | |
Using rack-cache (1.2) | |
Using rack-test (0.6.1) | |
Using hike (1.2.1) | |
Using tilt (1.3.3) | |
Using sprockets (2.1.3) | |
Installing actionpack (3.2.2) | |
Using mime-types (1.19) | |
Using polyglot (0.3.3) | |
Using treetop (1.4.10) | |
Using mail (2.4.4) | |
Installing actionmailer (3.2.2) | |
Using arel (3.0.2) | |
Using tzinfo (0.3.33) | |
Installing activerecord (3.2.2) | |
Installing activeresource (3.2.2) | |
Using addressable (2.3.2) | |
Using bundler (1.2.0) | |
Using coffee-script-source (1.3.3) | |
Using execjs (1.4.0) | |
Using coffee-script (2.2.0) | |
Using rack-ssl (1.3.2) | |
Using json (1.7.5) | |
Using rdoc (3.12) | |
Installing thor (0.14.6) | |
Installing railties (3.2.2) | |
Using coffee-rails (3.2.2) | |
Using excon (0.16.2) | |
Using heroku-api (0.3.5) | |
Using launchy (2.1.2) | |
Using netrc (0.7.7) | |
Using rest-client (1.6.7) | |
Using rubyzip (0.9.9) | |
Using heroku (2.31.2) | |
Using jquery-rails (2.1.2) | |
Installing rails (3.2.2) | |
Using sass (3.2.1) | |
Using sass-rails (3.2.5) | |
Using sqlite3 (1.3.6) | |
Using uglifier (1.3.0) | |
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed. | |
$ git add -A | |
$ git commit -m 'Update Gemtile' | |
[master 546179e] Update Gemtile | |
2 files changed, 77 insertions(+), 69 deletions(-) | |
rewrite Gemfile (77%) |
vi Gemfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem 'rails', '3.2.2' | |
gem 'jquery-rails' | |
group :assets do | |
gem 'sass-rails', '~> 3.2.3' | |
gem 'coffee-rails', '~> 3.2.1' | |
gem 'uglifier', '>= 1.0.3' | |
end | |
group :test, :development do | |
gem 'sqlite3' | |
gem 'heroku' | |
end | |
group :production do | |
gem 'pg' | |
gem 'thin' | |
end |
herokuにアプリを作成する
以下コマンドを実行
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ heroku create --stack cedar | |
Creating sultry-cliffs-6716... done, stack is cedar | |
http://sultry-cliffs-6716.herokuapp.com/ | git@heroku.com:sultry-cliffs-6716.git | |
Git remote heroku added | |
$ heroku labs:enable user_env_compile | |
$ heroku config:add RUBY_VERSION=ruby-1.9.3 # ←ruby-1.9.3-p194はherokuでまだ使えないみたいなので、バージョン騙すw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git push heroku master | |
Counting objects: 67, done. | |
Delta compression using up to 4 threads. | |
Compressing objects: 100% (53/53), done. | |
Writing objects: 100% (67/67), 26.85 KiB, done. | |
Total 67 (delta 5), reused 0 (delta 0) | |
-----> Heroku receiving push | |
-----> Ruby/Rails app detected | |
-----> Using RUBY_VERSION: ruby-1.9.3 | |
WARNING: RUBY_VERSION support has been deprecated and will be removed entirely on August 1, 2012. | |
See https://devcenter.heroku.com/articles/ruby-versions#selecting_a_version_of_ruby for more information. | |
-----> Installing dependencies using Bundler version 1.2.0 | |
Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment | |
Fetching gem metadata from https://rubygems.org/....... | |
Installing rake (0.9.2.2) | |
Installing i18n (0.6.1) | |
Installing multi_json (1.3.6) | |
Installing activesupport (3.2.2) | |
Installing builder (3.0.3) | |
Installing activemodel (3.2.2) | |
Installing erubis (2.7.0) | |
Installing journey (1.0.4) | |
Installing rack (1.4.1) | |
Installing rack-cache (1.2) | |
Installing rack-test (0.6.1) | |
Installing hike (1.2.1) | |
Installing tilt (1.3.3) | |
Installing sprockets (2.1.3) | |
Installing actionpack (3.2.2) | |
Installing mime-types (1.19) | |
Installing polyglot (0.3.3) | |
Installing treetop (1.4.10) | |
Installing mail (2.4.4) | |
Installing actionmailer (3.2.2) | |
Installing arel (3.0.2) | |
Installing tzinfo (0.3.33) | |
Installing activerecord (3.2.2) | |
Installing activeresource (3.2.2) | |
Installing coffee-script-source (1.3.3) | |
Installing execjs (1.4.0) | |
Installing coffee-script (2.2.0) | |
Installing rack-ssl (1.3.2) | |
Installing json (1.7.5) with native extensions | |
Installing rdoc (3.12) | |
Installing thor (0.14.6) | |
Installing railties (3.2.2) | |
Installing coffee-rails (3.2.2) | |
Installing daemons (1.1.9) | |
Installing eventmachine (1.0.0) with native extensions | |
Installing jquery-rails (2.1.2) | |
Installing pg (0.14.1) with native extensions | |
Using bundler (1.2.0) | |
Installing rails (3.2.2) | |
Installing sass (3.2.1) | |
Installing sass-rails (3.2.5) | |
Installing thin (1.4.1) with native extensions | |
Installing uglifier (1.3.0) | |
Your bundle is complete! It was installed into ./vendor/bundle | |
Post-install message from rdoc: | |
Depending on your version of ruby, you may need to install ruby rdoc/ri data: | |
<= 1.8.6 : unsupported | |
= 1.8.7 : gem install rdoc-data; rdoc-data --install | |
= 1.9.1 : gem install rdoc-data; rdoc-data --install | |
>= 1.9.2 : nothing to do! Yay! | |
Cleaning up the bundler cache. | |
-----> Writing config/database.yml to read from DATABASE_URL | |
-----> Preparing app for Rails asset pipeline | |
Running: rake assets:precompile | |
Asset precompilation completed (9.97s) | |
-----> Rails plugin injection | |
Injecting rails_log_stdout | |
Injecting rails3_serve_static_assets | |
-----> Discovering process types | |
Procfile declares types -> (none) | |
Default types for Ruby/Rails -> console, rake, web, worker | |
-----> Compiled slug size is 20.3MB | |
-----> Launching... done, v7 | |
http://sultry-cliffs-6716.herokuapp.com deployed to Heroku | |
To git@heroku.com:sultry-cliffs-6716.git | |
* [new branch] master -> master |
作成したアプリを見てみましょう。
以下、コマンドを打つと、safariが起動します。
heroku openようやく完了!
scaffoldでアプリを作る
まずは、デフォルト表示されるindex.htmlを消します。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rm -f public/index.html | |
$ git add -A | |
$ git commit -m'Delete default index.html' | |
[master 0aff2b8] Delete default index.html | |
1 file changed, 241 deletions(-) | |
delete mode 100644 public/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ rails g scaffold bookmark name:string url:string | |
invoke active_record | |
create db/migrate/20120917103255_create_bookmarks.rb | |
create app/models/bookmark.rb | |
invoke test_unit | |
create test/unit/bookmark_test.rb | |
create test/fixtures/bookmarks.yml | |
route resources :bookmarks | |
invoke scaffold_controller | |
create app/controllers/bookmarks_controller.rb | |
invoke erb | |
create app/views/bookmarks | |
create app/views/bookmarks/index.html.erb | |
create app/views/bookmarks/edit.html.erb | |
create app/views/bookmarks/show.html.erb | |
create app/views/bookmarks/new.html.erb | |
create app/views/bookmarks/_form.html.erb | |
invoke test_unit | |
create test/functional/bookmarks_controller_test.rb | |
invoke helper | |
create app/helpers/bookmarks_helper.rb | |
invoke test_unit | |
create test/unit/helpers/bookmarks_helper_test.rb | |
invoke assets | |
invoke coffee | |
create app/assets/javascripts/bookmarks.js.coffee | |
invoke scss | |
create app/assets/stylesheets/bookmarks.css.scss | |
invoke scss | |
create app/assets/stylesheets/scaffolds.css.scss | |
$ rake db:migrate | |
== CreateBookmarks: migrating ================================================ | |
-- create_table(:bookmarks) | |
-> 0.0012s | |
== CreateBookmarks: migrated (0.0013s) ======================================= | |
$ sed -i -e "s/ # root:to => 'welcome#index'/ root:to => 'bookmarks#index'/" config/routes.rb | |
$ git add -A | |
$ git commit -m 'rails g scaffold bookmark' | |
# On branch master | |
# Changes not staged for commit: | |
# (use "git add <file>..." to update what will be committed) | |
# (use "git checkout -- <file>..." to discard changes in working directory) | |
# | |
# modified: config/routes.rb | |
# | |
# Untracked files: | |
# (use "git add <file>..." to include in what will be committed) | |
# | |
# app/assets/javascripts/bookmarks.js.coffee | |
# app/assets/stylesheets/bookmarks.css.scss | |
# app/assets/stylesheets/scaffolds.css.scss | |
# app/controllers/bookmarks_controller.rb | |
# app/helpers/bookmarks_helper.rb | |
# app/models/bookmark.rb | |
# app/views/bookmarks/ | |
# config/routes.rb-e | |
# db/migrate/ | |
# db/schema.rb | |
# test/fixtures/bookmarks.yml | |
# test/functional/bookmarks_controller_test.rb | |
# test/unit/bookmark_test.rb | |
# test/unit/helpers/ | |
no changes added to commit (use "git add" and/or "git commit -a") |
migrationとは、Rubyスクリプトによって、テーブルの作成やカラムの構成変更を行う機能のこと。
詳しくは、次のサイトを参考にしてください。
(参考サイト:Ruby on Rails : migration 機能でデータベーススキーマを変更する)
それでは、メンテナンスモードに切り替えます。メンテナンスモードなので、エラーが表示されなくなります。
heroku maintenance:onherokuにdeployします。
git push heroku masterheroku側もmigrateします。
heroku run rake db:migrateメンテナンスモードを解除します。
heroku maintenance:offherokuを開いて確認
heroku openこんな画面が開いたらOK
herokuでアプリ公開まで出来ました!
0 件のコメント:
コメントを投稿