rails解説セミナー 第1章

Post on 11-Apr-2017

207 Views

Category:

Education

4 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1 #Rails

http://railstutorial.jp/

Rails

by YassLab

Rails

( )

( )

( )

( )

1. . 2.

. 3.

. 4.

. 5.

.

( )

( )

Rails

• .

• Web

• ! Emacs → Cloud 9

• .

• / .

• :(

Ready?

!

1 #Rails

http://railstutorial.jp/

Rails

by YassLab

• Rails :

• Ruby/Rails

• Git/Bitbucket

• Heroku

http://railstutorial.jp/

Rails

by YassLab

• RSpec minitest

• (RSpec Cucumber )

• Web

• Rails

• Ruby 2.3 Rails 5.0

• Rails

hello_app

toy_app Rails Way

sample_app 1 1

1.1 • 1.1.1

• HTML/CSS/JavaScript

• Ruby

• cf. 4 Try Ruby http://tryruby.org/

• 1.1.2 $ ~~~ Rails

1.1

1 1.2

(OS )

http://railstutorial.jp/

Rails

by YassLab

1. IDE ( ) - Cloud9 ( IDE) - nitrous.io ( 😭) - RubyMine ( )

2. (※ Inspect ) - Google Chrome- Firefox - Safari

1.2.1

1.2.1

• - Mac: iTerm2, Terminal.app. - Linux: Terminal - Windows: Linux (Virtual Box )

Git Bash Heroku Toolbelt

• - Sublime Text, TextMate, Atom - Vim, Emacs

• Google

• Google

•Rails

※ : 1.1

:

Ruby/Rails

Ruby 2.2.0

Ruby/Rails

RubyGems ( )

rbenv (or rvm)

ruby-build

ruby $ rbenv install 2.2.0

Ruby 1.9.3 Ruby 2.3.0RubyGems ( )RubyGems ( )

rails 3.2 rails 5.0

$ rbenv global 2.2.0 $ rbenv local 2.3.0

(Gem) $ gem install rails --version 4.2.2

rails (4.2.2) , bundler, pry, …

$ rbenv install 1.9.3

1 1.2

(Cloud9 )

http://railstutorial.jp/

Rails

by YassLab

Cloud9

Cloud9

Cloud9

Cloud9

Rails1. $ gem install rails --version 5.0.0.1

2. $ rails _5.0.0.1_ new hello_app

3. $ cd hello_app

4. $ rails --version => Rails 5.0.0.1

5. $ rails server -b $IP -p $PORT : $ rails server

6. Cloud9 Preview → Preview Running Application : http://localhost:3000/

Cloud9

Cloud9

1. 2. URL 3.

https://ide.c9.io/yasulab/rails-tutorial

URL “Collaborate” → “Group Chat”

:

http://www.slideshare.net/yasulab/presentations

https://rails-tutorial-yasulab.c9.io

( : )

1 1.2

(Linux )

http://railstutorial.jp/

Rails

by YassLab

1. rbenv ruby-build ( ) https://github.com/sstephenson/rbenv#installation https://github.com/sstephenson/ruby-build#ruby-build

2. Ruby $ rbenv install 2.3.0

: sudo apt-get libyaml-dev libxslt-dev libxml2-dev : libsqlite3-dev ( !)

3. rbenv $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile $ source .bash_profile$ rbenv global 2.3.0

4. Rails $ gem install rails --version 5.0.0.1

$ which ruby ~/.rbenv/shims/ruby $ which rails ~/.rbenv/shims/rails $ which gem ~/.rbenv/shims/gem

$ ruby -v ruby 2.3.0 $ rails --version Rails 5.0.0.1 $ gem --version 2.5.1

1 1.2

(Mac )

http://railstutorial.jp/

Rails

by YassLab

1. Homebrew : http://brew.sh/index_ja.html

$ brew install libtool libxslt libksba openssl libyaml

2. rbenv ruby-build $ brew install rbenv ruby-build

3. Ruby & $ rbenv install 2.3.0

4. rbenv $ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile $ source .bash_profile$ rbenv global 2.3.0

5. RubyGems Rails $ gem install rails --version 5.0.0.1

$ which ruby ~/.rbenv/shims/ruby $ which rails ~/.rbenv/shims/rails $ which gem ~/.rbenv/shims/gem

$ ruby -v ruby 2.3.0 $ rails --version Rails 5.0.0.1 $ gem --version 2.5.1

1 1.2

(Windows )

http://railstutorial.jp/

Rails

by YassLab

1. Vagrant+Virtual Box Rails ※

2. Linux - VMWare Player / Virtual Box - Ubuntu 14.04 LTS - Linux - http://railstutorial.jp/screencasts#ch01

$ which ruby ~/.rbenv/shims/ruby $ which rails ~/.rbenv/shims/rails $ which gem ~/.rbenv/shims/gem

$ ruby -v ruby 2.3.0 $ rails --version Rails 5.0.0.1 $ gem --version 2.5.1

1 1.2

(Vagrant )

http://railstutorial.jp/

Rails

by YassLab

1. https://github.com/yasslab/railstutorialjp_starter_kit

2.

3. Ruby & $ rbenv install 2.3.0

4. RubyGems Rails $ gem install rails --version 5.0.0.1

$ which ruby ~/.rbenv/shims/ruby $ which rails ~/.rbenv/shims/rails $ which gem ~/.rbenv/shims/gem

$ ruby -v ruby 2.3.0 $ rails --version Rails 5.0.0.1 $ gem --version 2.5.1

1 1.3

http://railstutorial.jp/

Rails

by YassLab

1. ✅ mkdir workspace ; cd workspace

2. ✅ rails _5.0.0.1 new hello_app

3. Gemfile (gem version )

4. $ bundle install

5. application_controller.rb routes.rb

6. $ rails server -b $IP -p $PORT

1.3

:

Hello, world?

: MVC ( )

: Unix

1 1.4 Git

http://railstutorial.jp/

Rails

by YassLab

Git :

$ cd ~/workspace/hello_app $ git config --global user.name "Your Name" $ git config --global user.email your@example.com $ git config --global push.default matching $ git config --global alias.co checkout $ git init$ git add -A $ git commit -m “Initial commit” $ git log ( ) GitHub BitBucket .

Git

GitHub: github.com

BitBucket: bitbucket.org

1 1.5

http://railstutorial.jp/

Rails

by YassLab

1. Gemfile (production pg gem )

2. $ bundle install --without production

3. $ git commit -a -m "Update Gemfile for Heroku"

4. $ heroku login

5. $ heroku keys:add

6. $ heroku create

7. $ git push heroku master

8. $ heroku rename < >

Heroku !

Heroku ( )

• Rails :

• Cloud9

• Ruby / Rails

• Git (Bitucket GitHub !)

• hello_app Heroku

: Rails

Rails http://railsguides.jp/getting_started.html

!( )

!

• :)

• : http://railstutorial.jp/seminars

• :) ,

.

• , .

1 #Rails

http://railstutorial.jp/

Rails

by YassLab

top related