Ubuntu 14.04 で、ruby on rails passenger をインストールして apache 連携する

passenger インストール cd ~/ rbenv exec gem install passenger rbenv rehash passenger-install-apache2-module実行 rbenv exec passenger-install-apache2-module passenger-install-apache2-module 詳細 This installer will guide you through the entire installation process. It shouldn't take more than 3 minutes in total. Here's what you can expect from the installation process: 1. The Apache 2 module will be installed for you. 2. You'll learn how to configure Apache. 3. You'll learn how to deploy a Ruby on Rails application....

2014-11-14 ·  2014-11-14 · 4 分 · 755 文字

Ubuntu 14.04 libwebsockets クライアントを試す

libwebsockets build sudo aptitude install cmake cd ~/works git clone git://git.libwebsockets.org/libwebsockets cd libwebsockets/ mkdir build cd build cmake .. make -j8 # sudo make install サンプルとして作成したサーバに libwebsocket-test-echo サンプルからアクセスする server rails 上に em-websocket を実装したcontrollerを用意する ※ rails に関しては、省略 Ubuntu 14.04 libwebsockets クライアントを試す libwebsockets build sudo aptitude install cmake cd ~/works git clone git://git.libwebsockets.org/libwebsockets cd libwebsockets/ mkdir build cd build cmake .. make -j8 # sudo make install サンプルとして作成したサーバに libwebsocket-test-echo サンプルからアクセスする server rails 上に em-websocket を実装したcontrollerを用意する...

2014-10-03 ·  2014-10-03 · 2 分 · 224 文字

Ubuntu 14.04 rails scoffoldでEntity作成、からDB migrateまで

以下のような形式で generate できる bundle exec rails generate scaffold [entity_name] [column_name]:[data_type][column_name]:[data_type] # 間違えたら! bundle exec rails destroy scaffold "name" data type integer, string, timestamp などなどが使える Generateした各ファイルをそれぞれ条件を追加するように、下記のように修正 db/migrate/YYYYMMDDhhmmss_create_[entity_name].rb 以下のように、NotNullや桁指定、デフォルト指定ができる class CreateEvents < ActiveRecord::Migration def change create_table :[entity_name] do |t| t.string :column_name, :null => false, :limit => 1, :default => 0 t.timestamps end end end 作成した rb ファイルで、DB再作成 # 通常DB作成 # bundle exec rake db:migrate # DB再作成(db/schema.rb より再実行) # bundle exec rake db:reset # DB再作成(db/migrate/**....

2014-10-03 ·  2014-10-03 · 1 分 · 86 文字

Ubuntu 14.04 ruby2.1.2 で ActiveRecord4.1.6 を使用し、postgresql4.1.6 へアクセス

まずはdatabase 確認 sudo su postgres -c psql install activerecord,pg mkdir -p ~/works/99_sample/02_activerecord cd ~/works/99_sample/02_activerecord gem install activerecord gem install pg gem list DBユーザtest_nameを作成しておく sudo su postgres -c psql create role test_name superuser login; \password test_name Enter new password: test_name Enter it again: test_name create database test_name; config/database.yml mkdir -p config && vim config/database.yml db: production: adapter: postgresql host: localhost username: test_name password: test_name database: test_name development: adapter: postgresql host: localhost username: test_name password: test_name database: test_name db/migrate配下に、3ファイルを配置(rails環境からコピー) mkdir -p db/migrate...

2014-10-03 ·  2014-10-03 · 1 分 · 130 文字

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 文字