Sinatraでアプリ構築
http://www.sinatrarb.com/intro-jp.html
アプリ構築
プロジェクト作成
$ mkdir hello-sinatra $ cd hello-sinatra $ bundle init
Gemfile
# A sample Gemfile source "https://rubygems.org" gem "sinatra"
gemをインストール
$ bundle install --path=vendor/bundle
ファイルを作成
$ touch app.rb
require 'sinatra' get '/' do 'Hello Sinatra!' end
サーバ起動
$ bundle exec ruby app.rb
参考
nodebrewでnode.jsをインストール
node.jsのバージョン管理システム
https://github.com/hokaccha/nodebrew
インストール(github 公式documentより)
$ curl -L git.io/nodebrew | perl - setup ... install nodebrew in $HOME/.nodebrew ======================================== Add path: export PATH=$HOME/.nodebrew/current/bin:$PATH ========================================
~/.zshrcに追加
export PATH=$HOME/.nodebrew/current/bin:$PATH
$ source ~/.zshrc $ nodebrew help
http://nodejs.org/ とかから最新のversion調べて、インストール
$ nodebrew install v0.10.22
確認、インストールしたものを使用
$ nodebrew ls $ nodebrew use v0.10.22 $ node -v v0.10.22