2012-05-17
Redmine 2.0.0 にアップデートしてみた
1.4.1 から 2.0.0
『generate_session_store』のとこで
注記がでた
rake generate_session_store Note: The rake task generate_session_store has been deprecated, please use the replacement version generate_secret_token
コマンド変わるのかな?
そのままで動いた。
けど db:migrate したらパーミッションエラー出たので chmode してみた。*2
$ rake generate_secret_token $ rake db:migrate RAILS_ENV=production Rails Error: Unable to access log file. Please ensure that /var/lib/redmine/2.0.0/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed. OpenIdAuthentication.store is nil. Using in-memory store. Creating scope :open. Overwriting existing method Version.open. Creating scope :active. Overwriting existing method User.active. DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in CollectiveIdea::Acts::NestedSet::Model instead. (called from include at /var/lib/redmine/2.0.0/lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb:58) DEPRECATION WARNING: The InstanceMethods module inside ActiveSupport::Concern will be no longer included automatically. Please define instance methods directly in CollectiveIdea::Acts::NestedSet::Model instead. (called from include at /var/lib/redmine/2.0.0/lib/plugins/awesome_nested_set/lib/awesome_nested_set/awesome_nested_set.rb:58) Creating scope :open. Overwriting existing method Issue.open. $ sudo chmod 0666 /var/lib/redmine/2.0.0/log/production.log $ rake db:migrate RAILS_ENV=production $
Memo
特に引っかかるとこもなく、Redmine2 から Rails3.2 になって他は特にないのかな?
Link
参考サイト
2012-05-14
Redmine 1.4.2 リリースされたけど 2.0.0 もリリースされそう
Redmine 1.4.2 が 2012-05-13 にリリース されたわけですが、
ロードマップ見ると 2012-05-15 に Rails3 対応の Redmine 2.0.0 がリリースされそうな感じ。
うーん、どうしよ(´・ω・`)
2012-05-06
さくらVPSにUbuntuインストール後の設定メモ その4 Redmine
install: apache2
sudo aptitude install apache2 sudo aptitude install apache2-threaded-dev sudo sysv-rc-conf apache2 on
install: Ruby (aptitude installの場合)
sudo aptitude install build-essential sudo aptitude install ruby1.9.3
install: Ruby (RVMの場合)
RVM でインストール
Install: curl
sudo aptitude install curl
Install: RVM
cd curl -L get.rvm.io | bash -s stable source ~/.rvm/scripts/rvm rvm requirements
ここで以下表示される
: Additional Dependencies: # For Ruby / Ruby HEAD (MRI, Rubinius, & REE), install the following: ruby: /usr/bin/apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion :
なので必要なパッケージをインストール
sudo aptitude -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
Install: Ruby
rvm install 1.9.3
gemも一緒にインストールされるみたい
gem -v 1.8.24
bachrc
bachrc に追加しておくとよいと思う
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
ImageMagick
sudo aptitude install imagemagick
:
convert -version
convert -version
Version: ImageMagick 6.5.7-8 2012-04-30 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2009 ImageMagick Studio LLC
MySQL
sudo aptitude install mysql-server mysql-devel
設定など
default-character-set というオプションは廃止になり、このオプションを記述していると、
起動時にエラーを吐いてこけます。
Ubuntu日本語フォーラム / MySQLが起動できなくなりました。
- /etc/mysql/my.cnf
:[mysqld] character-set-server=utf8 default-character-set=utf8 :
MySQLにRedmineのデータベースとユーザーを作成
mysql -u root -p #パスワード入力 > create database redmine character set utf8; > create user 'redmine'@'localhost' identified by 'PASSWORD'; > grant all privileges on redmine.* to 'redmine'@'localhost'; > quit;
MySQLの起動
sudo service mysql restart
OS再起動した時にMySQLを起動
sudo sysv-rc-conf mysql on
Redmine
/var/lib/redmine/1.4.1
とします。
現在の最新バージョン調べてからダウンロード
アドレス変わる?
sudo mkdir /var/lib/redmine cd /var/lib/redmine sudo wget http://rubyforge.org/frs/download.php/76033/redmine-1.4.1.tar.gz sudo tar zxvf redmine-1.4.1.tar.gz sudo mv redmine-1.4.1 1.4.1
database.yml
cd /var/lib/redmine/1.4.1/config/ sudo cp database.yml.example database.yml
- config/database.yml
production: # adapter: mysql adapter: mysql2 database: redmine host: localhost username: redmine password: ******** encoding: utf8
configuration.yml
cd /var/lib/redmine/1.4.1/config/ sudo cp configuration.yml.example configuration.yml
- config/configuration.yml
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: "localhost"
port: 25
bundle install
sudo gem install bundler bundle install --without development test postgresql sqlite
bundle install でエラー
mysql2 のエラー出たら
An error occured while installing mysql2 (0.2.18), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.2.18'` succeeds before bundling.
下記が足りないらしいのでインストール。それからまた bundle install。
sudo aptitude install libmysqlclient-dev
rmagick でエラー出たら
An error occured while installing rmagick (2.13.1), and Bundler cannot continue. Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.
下記が足りないらしいのでインストール。それからまた bundle install。
sudo aptitude install libmagickcore-dev libmagickwand-dev
セッションストア秘密鍵を生成とデータベース上にテーブルを作成
cd /var/lib/redmine/1.4.1 rake generate_session_store rake db:migrate RAILS_ENV=production
デフォルトデータをデータベースに登録
RAILS_ENV=production rake redmine:load_default_data
パーミッションの設定
cd /var/lib/redmine/1.4.1 sudo chown -R root:root files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets
Passenger
Install: passenger
gem install passenger --no-ri --no-rdoc
PassengerのApache用モジュール
インストールが完了後の表示は、後で使うので控えておく。
passenger-install-apache2-module
がしかし色々足りないとメッセージ
Checking for required software... * GNU C++ compiler... found at /usr/bin/g++ * Curl development headers with SSL support... not found * OpenSSL development headers... found * Zlib development headers... found * Ruby development headers... found * OpenSSL support for Ruby... found * RubyGems... found * Rake... found at /home/cortyuming/.rvm/wrappers/ruby-1.9.3-p194/rake * rack... found * Apache 2... found at /usr/sbin/apache2 * Apache 2 development headers... not found * Apache Portable Runtime (APR) development headers... not found * Apache Portable Runtime Utility (APU) development headers... not found Some required software is not installed. But don't worry, this installer will tell you how to install them. Press Enter to continue, or Ctrl-C to abort. -------------------------------------------- Installation instructions for required software * To install Curl development headers with SSL support: Please run apt-get install libcurl4-openssl-dev or libcurl4-gnutls-dev, whichever you prefer. * To install Apache 2 development headers: Please run apt-get install apache2-prefork-dev as root. * To install Apache Portable Runtime (APR) development headers: Please run apt-get install libapr1-dev as root. * To install Apache Portable Runtime Utility (APU) development headers: Please run apt-get install libaprutil1-dev as root.
親切に足りないパッケージを教えてくれるので全てインストール
sudo aptitude -y install apache2-prefork-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev
再び「passenger-install-apache2-module」。
インストール時に表示されるテキストをコピーしておくのを忘れずに。
例(環境により異なる)
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.11 PassengerRuby /usr/local/bin/ruby
passengerの設定
前述のコピーを以下のようにする
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
「RailsBaseURI /redmine」も付け加える
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.11 PassengerRuby /usr/local/bin/ruby RailsBaseURI /redmine
設定を読み込んで、apache 再起動
sudo a2enmod passenger sudo service apache2 restart
URLのサブディレクトリでURLにアクセスできるように
sudo ln -s /var/lib/redmine/1.4.1/public /var/www/html/redmine
パーミッション
ubuntu だと 「apache」ではなく「www-data」となる模様
cd /var/lib/redmine/1.4.1 sudo chown -R www-data.www-data files log tmp public/plugin_assets sudo chmod -R 755 files log tmp public/plugin_assets
「cannot load such file -- mysql (MissingSourceFile)」
- config/database.yml
production:
# adapter: mysql
adapter: mysql2
Internal error
Internal error An error occurred on the page you were trying to access. If you continue to experience problems please contact your Redmine administrator for assistance. If you are the Redmine administrator, check your log files for details about the error. Back
ログ見る
- /var/lib/redmine/1.4.1/log/production.log
よく解らん。
db:migrateしてみる
$ rake db:migrate RAILS_ENV=production Rails Error: Unable to access log file. Please ensure that /var/lib/redmine/1.4.1/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed. :
ログのパーミッションが云々
sudo chmod 666 /var/lib/redmine/1.4.1/log/production.log
もう一回 db:migrate
$ rake db:migrate RAILS_ENV=production : rake aborted! Permission denied - /var/lib/redmine/1.4.1/db/schema.rb
sudo chmod 777 /var/lib/redmine/1.4.1/db/
またまた db:migrate
$ rake db:migrate RAILS_ENV=production
何にも出なくなった。
Webブラウザで確認
管理 > 情報 で使用不可がある場合 (Administration > Information) *1
ユーザーの権限が足りていないためらしいので権限を与える*2
『Plugin assets directory writable』が☓なら
『ファイルリポジトリに書き込み可能』が不可の場合
<del datetime="2012-08-05T18:41:48+09:00"> cd /usr/local/redmine/1.4.1 sudo chmod 777 public/plugin_assets </del>
『Attachments directory writable』が☓なら
『Plugin assetsディレクトリに書き込み可能』が不可の場合
<del datetime="2012-08-05T18:41:48+09:00"> cd /usr/local/redmine/1.4.1 sudo chmod 777 files </del>
2012-04-30
Redmine と Git 連携メモ
Install and Config: GIt
sudo yum -y install git git config --global user.name admin git config --global user.email admin@domain.com git config --global color.diff auto git config --global color.status auto git config --global color.branch auto git config --global core.excludesfile ~/.gitignore git config --global core.shared true git config -l
Create a shared repository
サーバ側
adminユーザをオーナーにする
sudo mkdir /var/lib/git sudo chown -R admin.admin /var/lib/git cd /var/lib/git mkdir demo.git git init --bare --shared demo.git
グループで使う場合
グループを作成(例:hogegroup)
groupadd hogegroup
注意:「usermode -G hogegroup username」とかやると他のサブグループが消えてしまったりするので、
/etc/group に追加
- /etc/group
: hogegroup:x:0000:username :
所有グループとパーミッションを変更
chgrp -R hogegroup /var/lib/git chmod g+w -R /var/lib/git
Create a local repository
PC側
cd ~/projects/demo git init
適当にファイル作成してコミット
echo 'hoge' > hoge.txt git commit -m "first commit"
push and remote
git push ssh://USERNAME@HOSTNAME/var/lib/git/demo.git master git remote add origin ssh://USERNAME@HOSTNAME:PORTNUMBER/var/lib/git/demo.git git push origin
~/.ssh/config
host hogehost とか書いてたら、
ssh:の後に『//』を付けるのを忘れないようにする。
git push ssh://hogehost/var/lib/git/demo.git master git remote add origin ssh://hogehost:PORTNUMBER/var/lib/git/demo.git
Redmineのプロジェクトに登録する
新しいプロジェクトを作成してリポジトリのパスを登録
最新リビジョンとか表示などで連携を確認。
link
参考サイト

