Skip to content

Instantly share code, notes, and snippets.

@onigra
Last active May 13, 2021 09:43
Show Gist options
  • Save onigra/4594168 to your computer and use it in GitHub Desktop.
Save onigra/4594168 to your computer and use it in GitHub Desktop.
bundlerを使ったrailsプロジェクト作成手順 scaffold、bootstrapまで

作成

mkdir nyan
cd nyan

gem初期化

bundle init
vim Gemfile
  # gem 'rails' のコメントアウトを外す

gemインストール

bundle install --path vendor/bundle

railsアプリ作成

bundle exec rails new . -d mysql
# 一回目はこける

Gemfileに必要なGemを記述

vim Gemfile
bundle install --path vendor/bundle
bundle exec rake db:create
bundle exec rails s
bundle exec rails g bootstrap:install less
bundle exec rails g bootstrap:layout application fluid
bundle exec rails g scaffold item
bundle exec rake db:migrate
rm public/index.html
vi config/route.rb
root :to => 'wanteds#index'
bundle exec rails s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment