Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- docker
- Raspberry Pi
- nano
- BLE
- Arduino
- Python
- Raspberry Pi 3
- mqtt
- ruby on rails
- RUBY
- parser
- Android
- ubuntu
- uno
- 아두이노
- rails
- 개발환경
- java
- flask
- dht11
- IOT
- python3
- 라즈베리파이
- 오렌지파이
- STM32F4
- Nginx
- odroid-x2
- orange pi
- Server
- Beacon
Archives
- Today
- Total
[熱情]
ruby on rails - start 본문
Mac에서 Ruby 설치하기.
- 기본적을 ruby 2.0설치 되어 있다.
- 생활코딩 저보 활용. : https://opentutorials.org/course/1750/9611
-
|
- 루비 버전 확인
$ ruby -v
- 대화형 루비셸(irb)
$ irb
irb(main):001:0>
http://guides.rubyonrails.org/getting_started.html
what is rails.. ?
- Rails is a web application development framework written in the Ruby.
(sqlite3 설치 확임)
$ sqlite3 --version
Rails 설치
$ gem install rails
$ rails --version
Creating the Blog Application
- 대략 모든 사이트에서 시작은 blog로 하더라. ㅎㅎ
$ rails new blog
- 설치되는때까지 시간이 조금 걸림.
$ cd blog
File/Folder | Purpose |
---|---|
app/ | Contains the controllers, models, views, helpers, mailers and assets for your application. You'll focus on this folder for the remainder of this guide. |
bin/ | Contains the rails script that starts your app and can contain other scripts you use to setup, update, deploy or run your application. |
config/ | Configure your application's routes, database, and more. This is covered in more detail in Configuring Rails Applications. |
config.ru | Rack configuration for Rack based servers used to start the application. |
db/ | Contains your current database schema, as well as the database migrations. |
Gemfile Gemfile.lock | These files allow you to specify what gem dependencies are needed for your Rails application. These files are used by the Bundler gem. For more information about Bundler, see the Bundler website. |
lib/ | Extended modules for your application. |
log/ | Application log files. |
public/ | The only folder seen by the world as-is. Contains static files and compiled assets. |
Rakefile | This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application. |
README.md | This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on. |
test/ | Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications. |
tmp/ | Temporary files (like cache and pid files). |
vendor/ | A place for all third-party code. In a typical Rails application this includes vendored gems. |
Starting up the Web Server
$ bin/rails server
http://localhost:3000
$ bin/rails generate controller Welcome index
create app/controllers/welcome_controller.rb route get 'welcome/index' invoke erb create app/views/welcome create app/views/welcome/index.html.erb invoke test_unit create test/controllers/welcome_controller_test.rb invoke helper create app/helpers/welcome_helper.rb invoke assets invoke coffee create app/assets/javascripts/welcome.coffee invoke scss create app/assets/stylesheets/welcome.scss |
eidt : app/views/welcome/index.html.erb
< h1 >Hello, Rails!</ h1 > |
Comments