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

Ubuntu14.04 ruby 用 vim 設定

ruby 開発環境 vim install sudo apt-get install vim vim-gtk vim-gui-common install vim-nox vim --version |grep ruby +diff +menu -ruby +writebackup sudo apt-get install vim-nox vim --version |grep ruby +diff +menu +ruby +writebackup settings mkdir -p ~/.vim/bundle cd ~/.vim/bundle/ git clone http://github.com/Shougo/neobundle.vim vim ~/.vimrc set number set nocompatible filetype plugin indent off if has('vim_starting') set runtimepath+=~/.vim/bundle/neobundle.vim call neobundle#rc(expand('~/.vim/bundle')) endif " 以下は必要に応じて追加 " NeoBundle 'Shougo/unite.vim' " NeoBundle 'Shougo/neosnippet.vim' NeoBundle 'git://github.com/Shougo/neobundle.vim.git' NeoBundle 'git://github.com/Shougo/neocomplcache.git' NeoBundle 'git://github....

2014-10-23 ·  2014-10-23 · 1 分 · 164 文字

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