ラベル log の投稿を表示しています。 すべての投稿を表示
ラベル log の投稿を表示しています。 すべての投稿を表示

2009年8月22日土曜日

Rails on heroku

heroku.com上でRailsAppをdeployしたときのメモ

環境:
MacOSX 10.5.8
ruby 1.8.7 (2008-08-11 patchlevel 72)
rails 2.3.3
heroku-gem/1.1

手順:
localでdevelop

$ rails heroku
$ cd heroku
$ ./script/generate i18n_scaffold status content:text
$ rake db:migrate

*localでdbのmigrateして、deploy時に必要に応じてdb:pushする

$ ./script/generate i18n ja
$ cat config/environment.rb
config.time_zone = 'Tokyo'
config.i18n.default_locale = 'ja'

*i18n化 http://rails-i18n.org/wiki/wikipages/i18n-rails-guide


$ ./script/plugin install git://github.com/technoweenie/restful-authentication.git
$ mv vendor/plugins/restful-authentication/ vendor/plugins/restful_authentication/

>IMPORTANT FOR RAILS > 2.1 USERS To avoid a NameError exception (lighthouse tracker ticket), check out the code to have an underscore and not dash in its name:
*restful_authenticationはrenameが必要(?)のため、vendor/pluginsにinstall。他のはheroku上でinstallする。

$ ./script/generate authenticated user sessions
$ cat app/controllers/application_controller.rb
include AuthenticatedSystem
$ rake db:migrate

*restful_authenticationのためのmigrate

$ vi config.environment.rb
config.gem "searchlogic"
config.gem "will_paginate"
config.gem "jpmobile"

*localでは他のpluginはsudo gem installでインストールしておく


$ cat .gems
searchlogic
will_paginate
jpmobile

*.gemsにheroku上でのmanifestを書いておく。
herokuのplatform上に既にインストールされているgemsはhttp://installed-gems.heroku.com/

で、いろいろ開発して、git&heroku


$ heroku create appname
$ heroku info --app appname

*gitアカウント作成、キー登録後に、appの作成

$ git init
$ git add .
$ git commit -m "my first commit"


$ git remote add heroku git@heroku.com:appname.git
$ git push heroku master

*git remoteリポジトリにherokuを登録し、masterブランチにpush


$ heroku db:push

*必要に応じて、delopmentDBをdeployのherokuにpush。もしくはheroku rake db:migrateか?

$ heroku restart

*app serverのリスタート

2009年7月24日金曜日

gem 1.3.5 さくら

%cat .cshrc
set path $HOME/ROOT/bin
setenv RUBYLIB $HOME/ROOT/lib
setenv GEM_HOME $HOME/ROOT/lib/ruby/gem

%mkdir $HOME/ROOT
%ruby setup.rb --prefix=$HOME/ROOT

%gem18 -v
1.3.5

%gem18 update --system
Updating RubyGems
Nothing to update

%setenv RB_USER_INSTALL true
%gem18 install hpricot

2009年4月6日月曜日

vim-ruby on MacOSX

MacOSXにvim-rubyをインストール。

MacOSX 10.5.6
MacPort 1.710
sudo port -d selfupdate
sudo port -d sync

vim 7.2.147
port variants vim
sudo port install vim +ruby

vim-ruby vim-ruby-2007.05.07
sudo gem install vim-ruby
vim-ruby-install.rb

.vimrc
set nocompatible
syntax on
filetype on
filetype indent on
filetype plugin on
compiler ruby
set expandtab
set tabstop=2 shiftwidth=2 softtabstop=2
set autoindent

2009年3月5日木曜日

gem install mysql on MacOS Leopard

sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

mysqlはmacportではなく、mysqlのMacOSXをインストール済み。

2009年2月27日金曜日

uninstall zumoDrive on MacOSX

http://www.zumodrive.com/forums/12/topics/27

# First, go to System Preferences, then the Accounts page, then click on the Login Items tab. Find ZumoDrive in the list and uncheck it.
# Uninstall MacFUSE using the preference pane, remove the preference pane afterwards
# Remove ZumoDrive the application from /Applications
# Remove the directory: ~/Library/Application Support/ZumoDrive
# Remove the preferences file: ~/Library/Preferences/com.zecter.configuration.plist
We also install growl on the machine if you didn’t have it before. You can uninstall that with the growl uninstaller available

2009年2月17日火曜日

Security Update 2009-001

http://support.apple.com/kb/HT3438?viewlocale=ja_JP

2009年2月16日月曜日

Impressive-0.10.2 on MacOS Leopard

ImpressiveをLeopardへインストール。

Python 2.5.1
Impressive-0.10.2
- PyOpenGL http://pyopengl.sourceforge.net/
- PyGame http://www.pygame.org/
-- SDL framework for making PyGame
--- http://pygame.org/wiki/MacCompile
- PIL http://www.pythonware.com/products/pil/
Xpdf(MacPort)
GhostScript(MacPort)
pdftk(MacPort)
MPlayer(MacPort)

2008年5月17日土曜日

OpenVPN + bridge

/etc/openvpn/server.conf
で
dev tap0
とTAPデバイス名を指定する

2008年5月5日月曜日

bridge

[root@localhost ~]# yum install bridge-utils
Loading "kernel-module" plugin
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
extras 100% |=========================| 1.1 kB 00:00
rpmforge 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:00
updates 100% |=========================| 951 B 00:00
addons 100% |=========================| 951 B 00:00
adobe-linux-i386 100% |=========================| 951 B 00:00
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for bridge-utils to pack into transaction set.
bridge-utils-1.1-2.x86_64 100% |=========================| 4.9 kB 00:00
---> Package bridge-utils.x86_64 0:1.1-2 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
bridge-utils x86_64 1.1-2 base 28 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 28 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): bridge-utils-1.1-2 100% |=========================| 28 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: bridge-utils ######################### [1/1]

Installed: bridge-utils.x86_64 0:1.1-2
Complete!

OpenVPN

[root@localhost ~]# yum install openvpn.x86_64
Loading "kernel-module" plugin
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for openvpn to pack into transaction set.
openvpn-2.0.9-1.el5.rf.x8 100% |=========================| 20 kB 00:00
---> Package openvpn.x86_64 0:2.0.9-1.el5.rf set to be updated
--> Running transaction check
--> Processing Dependency: liblzo2.so.2()(64bit) for package: openvpn
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for lzo2 to pack into transaction set.
lzo2-2.02-3.el5.rf.x86_64 100% |=========================| 4.2 kB 00:00
---> Package lzo2.x86_64 0:2.02-3.el5.rf set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
openvpn x86_64 2.0.9-1.el5.rf rpmforge 372 k
Installing for dependencies:
lzo2 x86_64 2.02-3.el5.rf rpmforge 138 k

Transaction Summary
=============================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 509 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): lzo2-2.02-3.el5.rf 100% |=========================| 138 kB 00:01
(2/2): openvpn-2.0.9-1.el 100% |=========================| 372 kB 00:02
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: lzo2 ######################### [1/2]
Installing: openvpn ######################### [2/2]

Installed: openvpn.x86_64 0:2.0.9-1.el5.rf
Dependency Installed: lzo2.x86_64 0:2.02-3.el5.rf
Complete!

[root@localhost ~]# cd /etc/openvpn/
[root@localhost openvpn]# cp /usr/share/doc/openvpn-2.0.9/sample-config-files/server.conf
.
[root@localhost openvpn-2.0.9]# pwd
/usr/share/doc/openvpn-2.0.9
[root@localhost openvpn-2.0.9]# cp -r easy-rsa/ /etc/openvpn/
[root@localhost openvpn-2.0.9]# cd /etc/openvpn/

2008年5月4日日曜日

VirtualBox-1.6.0_30421_rhel5-1.x86_64.rpm

[root@localhost ~]# vi /etc/yum
yum/ yum.conf yum.repos.d/
[root@localhost ~]# vi /etc/yum.conf
[root@localhost ~]# yum install VirtualBox-1.6.0_30421_rhel5-1.x86_64.rpm
Loading "kernel-module" plugin
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Examining VirtualBox-1.6.0_30421_rhel5-1.x86_64.rpm: VirtualBox - 1.6.0_30421_rhel5-1.x86_64
Marking VirtualBox-1.6.0_30421_rhel5-1.x86_64.rpm to be installed
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Package VirtualBox.x86_64 0:1.6.0_30421_rhel5-1 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
VirtualBox x86_64 1.6.0_30421_rhel5-1 VirtualBox-1.6.0_30421_rhel5-1.x86_64.rpm 52 M

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 52 M
Is this ok [y/N]: y
Downloading Packages:
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: VirtualBox ######################### [1/1]

Creating group 'vboxusers'. VM users must be member of that group!

No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.

Compilation of the kernel module FAILED! VirtualBox will not start until this
problem is fixed. Please consult /var/log/vbox-install.log to find out why the
kernel module does not compile. Most probably the kernel sources are not found.
Install them and execute

/etc/init.d/vboxdrv setup

as root.


Installed: VirtualBox.x86_64 0:1.6.0_30421_rhel5-1
Complete!
[root@localhost ~]# vi /etc/group
[root@localhost ~]# vi /etc/yum.conf
[root@localhost ~]# yum install kernel-devel.x86_64
Loading "kernel-module" plugin
Loading "installonlyn" plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kernel-devel to pack into transaction set.
kernel-devel-2.6.18-53.1. 100% |=========================| 766 kB 00:00
---> Package kernel-devel.x86_64 0:2.6.18-53.1.14.el5 set to be installed
--> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
kernel-devel x86_64 2.6.18-53.1.14.el5 updates 4.9 M


Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 4.9 M
Is this ok [y/N]: y
Downloading Packages:
(1/1): kernel-devel-2.6.1 100% |=========================| 4.9 MB 00:03
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: kernel-devel ######################### [1/1]

Installed: kernel-devel.x86_64 0:2.6.18-53.1.14.el5
Complete!
[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-53.1.14.el5 #1 SMP Wed Mar 5 11:37:38 EST 2008 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]#

[root@localhost ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [??]
(Cannot create device /dev/vboxdrv with major 10 and minor 62)
[root@localhost ~]#
[root@localhost ~]# /etc/init.d/vboxdrv setup
Stopping VirtualBox kernel module [ OK ]
Removing old VirtualBox kernel module [ OK ]
Recompiling VirtualBox kernel module [ OK ]
Starting VirtualBox kernel module [ OK ]
[root@localhost ~]#