Нистратов Артём
anistratov@go-promo.ru
Ruby Version Manager
rvm install 2.1
rvm use 2.1
rvm list
2.1.3 :001 > 1 + 2
=> 3
2.1.3 :002 > puts 'Hello world!'
Hello world!
=> nil
2.1.3 :003 > 'Hello'.sub(/[l]+/, 'r').downcase.reverse.chars
=> ["o", "r", "e", "h"]
ruby -v
irb
Package Manager
gem install rails --no-ri --no-rdoc
rails new first_project
.
├── Gemfile
├── Gemfile.lock
├── Rakefile
├── app
| ├── assets
| ├── controllers
| ├── helpers
| ├── mailers
| ├── models
| └── views
├── bin
├── config
├── db
├── lib
├── log
├── public
├── test
├── tmp
└── vendor
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
bundle install
rake db:create
Dependency Resolver
Bundler обеспечивает согласованную среду для проектов на Ruby, отслеживая и устанавливая только те версии пакетов, которые необходимы.
ruby '2.1.2'
source 'https://rubygems.org'
gem 'rails', '~> 3.2.21'
gem 'migration_comments'
gem 'activerecord-mysql-unsigned'
Version Control System
git status
git add ./
git commit -m "Initial commit"