Rails 2.3.5 → 2.3.8 にする
config/environment.rb
RAILS_GEM_VERSION = '2.3.5' unless defined? RAILS_GEM_VERSION
↓
RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION
rake rails:update:configs # Update config/boot.rb from your current rails install
エラーが起きた
DEPRECATION WARNING: Rake tasks in vendor/plugins/forgot_password/tasks and vendor/plugins/restful-authentication/tasks are deprecated. Use lib/tasks instead. (called from /Users/takezi/local/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10)
plugins/*/tasks/*.rake
をリネームして回避
centos5.4 subversion1.5.6
# yum remove subversion # wget http://subversion.tigris.org/downloads/subversion-1.5.6.tar.gz # tar xzvf subversion-1.5.6.tar.gz # wget http://subversion.tigris.org/downloads/subversion-deps-1.5.6.tar.gz # tar xzvf subversion-deps-1.5.6.tar.gz # cd subversion-1.5.6 # ./configure \ > --prefix=/usr/local/subversion-1.5.6 \ > --with-berkeley-db \ > --with-ssl \ > --with-expat=builtin \ > --enable-shared # make # make install # ln -s /usr/local/subversion-1.5.6/bin/svn /usr/bin/svn
port update
port update
% sudo port selfupdate
古いパッケージ
% port outdated
古いパッケージ 一括update
% sudo port upgrade outdated
Mac OS X 10.5.6(Leopard) にSubversion インストール
% which svn /usr/bin/svn
% svn --version svn, version 1.4.4 (r25188) compiled Sep 23 2007, 22:32:34 Copyright (C) 2000-2006 CollabNet. Subversion is open source software, see http://subversion.tigris.org/ This product includes software developed by CollabNet (http://www.Collab.Net/). The following repository access (RA) modules are available: * ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol. - handles 'http' scheme - handles 'https' scheme * ra_svn : Module for accessing a repository using the svn network protocol. - handles 'svn' scheme * ra_local : Module for accessing a repository on local disk. - handles 'file' scheme
デフォルトで入っているがインストール
% sudo port install subversion
なんかいっぱいはいったぞ!!
% port installed apr @1.3.3_1 (active) apr-util @1.3.4_1 (active) cyrus-sasl2 @2.1.22_0+kerberos (active) db46 @4.6.21_4 (active) expat @2.0.1_0 (active) gettext @0.17_4 (active) gperf @3.0.4_0 (active) libiconv @1.12_2 (active) mysql5 @5.0.77_0+server (active) ncurses @5.7_0 (active) ncursesw @5.7_0 (active) neon @0.28.3_0 (active) openssl @0.9.8j_0 (active) readline @6.0.000_1 (active) serf @0.3.0_0 (active) sqlite3 @3.6.11_0 (active) subversion @1.5.6_0 (active) zlib @1.2.3_2 (active) % which svn /opt/local/bin/svn % svn --version svn, バージョン 1.5.6 (r36142) コンパイル日時: Mar 23 2009, 14:46:15 Copyright (C) 2000-2008 CollabNet. Subversion はオープンソースソフトウェアです。 http://subversion.tigris.org/ を参照してください。 この製品には、CollabNet (http://www.Collab.Net/) によって開発されたソフトウェア が含まれています。 以下のリポジトリアクセス (RA) モジュールが利用できます: * ra_neon : Neon を利用して WebDAV (DeltaV) プロトコルでリポジトリにアクセスするモジュール。 - 'http' スキームを操作します - 'https' スキームを操作します * ra_svn : svn ネットワークプロトコルを使ってリポジトリにアクセスするモジュール。 - Cyrus SASL 認証を併用 - 'svn' スキームを操作します * ra_local : ローカルディスク上のリポジトリにアクセスするモジュール。 - 'file' スキームを操作します * ra_serf : serf を利用して WebDAV (DeltaV) プロトコルでリポジトリにアクセスするモジュール。 - 'http' スキームを操作します - 'https' スキームを操作します
Mac OS X 10.5.6(Leopard) にRuby on Rails インストール
Xcode
まずはXcodeToolsを付属のMac OS X Install Disc2 からインストール
ついでにDashcodeとWebObjectsもインストール
環境変数の設定
rubyは/usr/local、MySQLはMacPortsで/opt/localにインストールするのでPATHを通す
export PATH=/usr/local/bin:/opt/local/bin:/opt/local/sbin/:$PATH export MANPATH=/opt/local/man:/opt/local/share/man:$MANPATH
Ruby
デフォルトで入っているrubyは1.8.6なので、1.8.7をソースからコンパイルして/usr/localにインストールする
http://www.ruby-lang.org/ja/downloads/
% curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p72.tar.gz % tar zxvf ruby-1.8.7-p72.tar.gz % cd ruby-1.8.7-p72 % ./configure --prefix=/usr/local --enable-shared --enable-pthread % make % sudo make install % make clean
% ruby -v ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9.4.0] % which ruby /usr/local/bin/ruby
gem
http://rubyforge.org/frs/?group_id=126
% ftp http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz % tar zxvf rubygems-1.3.1.tgz % cd rubygems-1.3.1 % sudo ruby setup.rb
% gem -v 1.3.1 % which gem /usr/local/bin/gem
MacPorts
バイナリをダウンロードしてインストール
http://svn.macosforge.org/repository/macports/downloads/
MacPorts-1.7.0/MacPorts-1.7.0-10.5-Leopard.dmg
MySQL
インストール
% sudo port install mysql5 +server
my.cnf
my.cnf作成
% sudo cp /opt/local/share/mysql5/mysql/my-small.cnf /etc/my.cnf
[mysql],[mysqld]に追加する
default-character-set=utf8
初期化
% sudo -u mysql mysql_install_db5
起動設定
% sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
エイリアス
alias mysql="mysql5"
接続確認
% mysql -uroot
gem mysql
% sudo gem install mysql -- --with-mysql-config=/opt/local/lib/mysql5/bin/mysql_config
Rails 起動確認
% rails sample -dmysql % cd sample % rake db:create:all % script/generate scaffold bookmark name:string url:string % rake db:migrate % script/server
OK これで開発が出来そうね