LoginSignup
1
0

More than 5 years have passed since last update.

Rails5を入れる

Posted at

導入環境

ruby 2.3.3
OS:Mac(Sierra)

手順

rubyのバージョンを確認

$ ruby -v 
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]

rails5用のプロジェクトを作成する

$ mkdir rails_5_demo
$ cd rails_5_demo

bundle initする

$ bundle init
Writing new Gemfile to /Users/hiromichi.ema/development/myApps/rails_5_chat/Gemfile

Gemfileでraisのバージョンを指定する。
(今回は5.0.0.rc1を利用)

$ emacs Gemfile
source "https://rubygems.org"
gem 'rails', '>= 5.0.0.rc1', '< 5.1'

bundler を使ってrailsプロジェクトを生成!

$ bundle exec rails new . # ← 対象ディレクトリに入れるので. をつける。
 exist
 create  README.md
 create  Rakefile
 create  config.ru
 create  .gitignore
 conflict  Gemfile
Overwrite /Users/hiromichi.ema/development/myApps/rails_5_chat/Gemfile? (enter "h" for help) [Ynaqdh] Y # Gemfileを上書きしてもいいので、Yを選択
 force  Gemfile
 create  app
 create  app/assets/config/manifest.js
 create  app/assets/javascripts/application.js
 create  app/assets/javascripts/cable.js
 create  app/assets/stylesheets/application.css
 create  app/channels/application_cable/channel.rb
 create  app/channels/application_cable/connection.rb
 create  app/controllers/application_controller.rb
 create  app/helpers/application_helper.rb
 create  app/jobs/application_job.rb
# ...略
Installing sass-rails 5.0.6
Bundle complete! 15 Gemfile dependencies, 62 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
         run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted # 完了

rails server起動

$ bundle exec rails s
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.6.2 (ruby 2.3.3-p222), codename: Sleepy Sunday Serenity
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop

localhost:3000にアクセス!

test

できた!

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0