2012年8月6日月曜日

coreserverにREDMINEを入れる(未遂)

まずはpathを準備する。
vi .bashrc
#ruby
export PATH=$PATH:$HOME/bin:$HOME/lib/ruby/gem/bin
export RUBYLIB=$HOME/lib/:$HOME/lib/ruby
export GEM_HOME=$HOME/lib/ruby/gem
で、初期化。
source ~/.bashrc
ほんで、まずはrubygemをインストール
cd tmp/
wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz
tar xvzf rubygems-1.3.1.tgz
cd rubygems-1.3.1/
ruby setup.rb config --prefix=$HOME
source ~/.bashrc
rehash
gem -v
いけたら、今度はrailsを。今回は確実動作といわれている2.2.2をインストール。
gem install rails -y -v 2.2.2
INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list Killed
怒られたのでむりくり入れます。
gem install rails --ignore-dependencies --version 2.2.2
Successfully installed rails-2.2.2
1 gem installed
入ったはいいものの、
rails -v

/virtual/***/lib/rubygems.rb:636:in `report_activate_error':
 Could not find RubyGem rake (>= 0.8.3) (Gem::LoadError)
        from /virtual/***/lib/rubygems.rb:141:in `activate'
        from /virtual/ *** /lib/rubygems.rb:165:in `activate'
        from /virtual/ *** /lib/rubygems.rb:164:in `each'
        from /virtual/ *** /lib/rubygems.rb:164:in `activate'
        from /virtual/ *** /lib/rubygems.rb:49:in `gem'
        from /virtual/ *** /lib/ruby/gem/bin/rails:18
怒られたので、言われるがまま
gem install rake --version 0.8.3
Successfully installed rake-0.8.3
1 gem installedInstalling
 ri documentation for rake-0.8.3...
Installing RDoc documentation for rake-0.8.3...
そして確認。
rails -v
/virtual/ *** /lib/rubygems.rb:636:in `report_activate_error': Could not find RubyGem activesupport (= 2.2.2) (Gem::LoadError)
        from /virtual/ *** /lib/rubygems.rb:141:in `activate'
        from /virtual/ *** /lib/rubygems.rb:165:in `activate'
        from /virtual/ *** /lib/rubygems.rb:164:in `each'
        from /virtual/ *** /lib/rubygems.rb:164:in `activate'
        from /virtual/ *** /lib/rubygems.rb:49:in `gem'
        from /virtual/ *** /lib/ruby/gem/bin/rails:18
やっぱり怒られる。ので言われる通りに。
gem install activesupport --version 2.2.2
Successfully installed activesupport-2.2.2
1 gem installed
Installing ri documentation for activesupport-2.2.2...
Installing RDoc documentation for activesupport-2.2.2...
そして確認。
rails -v
/virtual/ *** /lib/rubygems.rb:636:in `report_activate_error': Could not find RubyGem activerecord (= 2.2.2) (Gem::LoadError)
        from /virtual/ *** /lib/rubygems.rb:141:in `activate'
        from /virtual/ *** /lib/rubygems.rb:165:in `activate'
        from /virtual/ *** /lib/rubygems.rb:164:in `each'
        from /virtual/ *** /lib/rubygems.rb:164:in `activate'
        from /virtual/ *** /lib/rubygems.rb:49:in `gem'
        from /virtual/ *** /lib/ruby/gem/bin/rails:18
怒られる。そしてまたまた言われるままに。
gem install activerecord --version 2.2.2
Successfully installed activerecord-2.2.2
1 gem installed
Installing ri documentation for activerecord-2.2.2...
Installing RDoc documentation for activerecord-2.2.2...
そして確認。
rails -v
/virtual/***/lib/rubygems.rb:636:in `report_activate_error': Could not find RubyGem actionpack (= 2.2.2) (Gem::LoadError)
        from /virtual/ *** /lib/rubygems.rb:141:in `activate'
        from /virtual/ *** /lib/rubygems.rb:165:in `activate'
        from /virtual/ *** /lib/rubygems.rb:164:in `each'
        from /virtual/ *** /lib/rubygems.rb:164:in `activate'
        from /virtual/ *** /lib/rubygems.rb:49:in `gem'
        from /virtual/ *** /lib/ruby/gem/bin/rails:18
サンドバッグ状態です。言われるがままに。
gem install actionpack --version 2.2.2
Successfully installed actionpack-2.2.2
1 gem installed
Installing ri documentation for actionpack-2.2.2...
Installing RDoc documentation for actionpack-2.2.2...
そして確認。
rails -v
/virtual/interestic/lib/rubygems.rb:636:in `report_activate_error': Could not find RubyGem actionmailer (= 2.2.2) (Gem::LoadError)
        from /virtual/interestic/lib/rubygems.rb:141:in `activate'
        from /virtual/interestic/lib/rubygems.rb:165:in `activate'
        from /virtual/interestic/lib/rubygems.rb:164:in `each'
        from /virtual/interestic/lib/rubygems.rb:164:in `activate'
        from /virtual/interestic/lib/rubygems.rb:49:in `gem'
        from /virtual/interestic/lib/ruby/gem/bin/rails:18
ここらへんで、だんだん嫌気が差し始めましたが、やっぱり言われるがまま。
gem install actionmailer --version 2.2.2
Successfully installed actionmailer-2.2.2
1 gem installed
Installing ri documentation for actionmailer-2.2.2...
Installing RDoc documentation for actionmailer-2.2.2...
そして確認。
rails -v
/virtual/interestic/lib/rubygems.rb:636:in `report_activate_error': Could not find RubyGem activeresource (= 2.2.2) (Gem::LoadError)
        from /virtual/interestic/lib/rubygems.rb:141:in `activate'
        from /virtual/interestic/lib/rubygems.rb:165:in `activate'
        from /virtual/interestic/lib/rubygems.rb:164:in `each'
        from /virtual/interestic/lib/rubygems.rb:164:in `activate'
        from /virtual/interestic/lib/rubygems.rb:49:in `gem'
        from /virtual/interestic/lib/ruby/gem/bin/rails:18
やっぱり言われるがまま。
gem install activeresource --version 2.2.2
Successfully installed activeresource-2.2.2
1 gem installed
Installing ri documentation for activeresource-2.2.2...
Installing RDoc documentation for activeresource-2.2.2...
そして確認。
rails -v
Rails 2.2.2
やっとrailsが入りました。 そしてredmineを入れようとまずはソースをチェックアウトします。
svn checkout http://redmine.rubyforge.org/svn/trunk/ redmine
パーミッションを変更
cd redmine
chmod -R o+w log tmp
configのdatabase.yml.exampleをdatabase.ymlにリネームして編集します。
vi database.yml
production:
  adapter: sqlite3
  database: db/prod.sqlite3
development:
  adapter: sqlite3
  database: db/dev.sqlite3
test:
  adapter: sqlite3
  database: db/test.sqlite3
#DB初期化
rake db:migrate RAILS_ENV=”production”

(in /virtual/interestic/tmp/redmine)rake aborted!
no such file to load -- bundler/setup/virtual/interestic/tmp/redmine/Rakefile:5
(See full trace by running task with --trace)
怒られます。 --traceオプションでどうなってるか確認します。
rake db:migrate RAILS_ENV='test' --trace
(in /virtual/interestic/tmp/redmine)rake aborted!
no such file to load -- bundler/setup/virtual/interestic/lib/rubygems/custom_require.rb:31:
in `gem_original_require'/virtual/interestic/lib/rubygems/custom_require.rb:31:
in `require'/virtual/interestic/tmp/redmine/config/boot.rb:6/virtual/interestic/lib/rubygems/custom_require.rb:31:
in `gem_original_require'/virtual/interestic/lib/rubygems/custom_require.rb:31:
in `require'/virtual/interestic/tmp/redmine/config/application.rb:1/virtual/interestic/lib/rubygems/custom_require.rb:31:
in `gem_original_require'/virtual/interestic/lib/rubygems/custom_require.rb:31:
in `require'/virtual/interestic/tmp/redmine/Rakefile:5/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:2349:
in `load'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:2349:
in `raw_load_rakefile'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:1985:
in `load_rakefile'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:2036:
in `standard_exception_handling'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:1984:
in `load_rakefile'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:1969:
in `run'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:2036:
in `standard_exception_handling'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/lib/rake.rb:1967:
in `run'/virtual/interestic/lib/ruby/gem/gems/rake-0.8.3/bin/rake:31/virtual/interestic/lib/ruby/gem/bin/rake:19:
in `load'/virtual/interestic/lib/ruby/gem/bin/rake:19
rakeがコケてるようで、ググると、「rakeが古いのでgemのアップデートしてrakeを最新に」と書いてあります。
gem update --system
Updating RubyGems
Updating rubygems-update
ERROR:  While executing gem ... (Gem::InstallError)
    rubygems-update requires Ruby version >= 1.8.7
ガビーン。1.8.7をまず入れないとダメそうです。