Ubuntu 14.04 で websocket, zeroMQ

rails 、postgresql、zeroMQ、websocketを使って通信するサンプル環境を作成中 create rails project cd 任意のディレクトリ rails new test_rails_postgres -d postgresql cd test_rails_postgres bundle install --path vendor/bundle bundle exec rake db:create db:migrate テスト起動確認 cd test_rails_postgres rails server http://[サーバアドレス]:3000へアクセス git 管理開始 cd test_rails_postgres git init vim .gitignore 以下を追加 doc/ *.swp *~ .project .DS_Store .idea .secret git add . git commit -m "initial commit." テスト設定 bundle exec rails generate scaffold book title:string author:string outline:text bundle exec rake db:migrate bundle exec rails server db確認 -- database list \l -- user list select * from pg_user; -- table list \d routes の確認 http://localhost:3000/rails/info/routes rails へwebsocket実装 websocket-rails install cd test_rails_postgres vim Gemfile # 以下を追加 gem 'websocket-rails' bundle install rails g websocket_rails:install # コントローラ作成 vim app/controllers/websocket_chat_controller....

2014-10-03 ·  2014-10-03 · 3 分 · 454 文字

Ubuntu14.04 Node.js をインストール

Ubuntu14.04 Node.jsをインストール install packages. sudo apt-get install git curl build-essential libssl-dev install nvm. git clone https://github.com/creationix/nvm.git ~/.nvm . ~/.nvm/nvm.sh nvm install 0.10 ######################################################################## 100.0% Now using node v0.10.31 nvm version vi ~/.bashrc # 以下追加 . ~/.nvm/nvm.sh nvm use v0.10.31 # defaultバージョンを指定 nvm alias default v0.10.31 # Node.jsはバージョン番号が偶数が安定バージョン、奇数は開発バージョン hellow world 作成 cd 任意のディレクトリ vim hellowworld.js ------------------------------------- var sys = require('sys'); var http = require('http'); var server = http.createServer( function (request, response) { response....

2014-09-10 ·  2014-09-10 · 2 分 · 331 文字