Archive

October, 2012Archive for

Redmine 2.1 & Block activity show(show only for admin)

October 23, 2012 admin No comments

vi app/controllers/activities_controller.rb

 def index
    @days = Setting.activity_days_default.to_i

    if !User.current.admin?
      render_404
      return
    end

 

rake tmp:cache:clear
rake tmp:sessions:clear
touch tmp/restart.txt

Categories: Redmine Tags:

How to upgrade Redmine 1.4 to Redmine 2.1 (CentOS 5.8)

October 23, 2012 admin No comments

Upgrade Ruby 1.9.3 with libyaml

Installing libyaml

#  cd /usr/src/
# wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
# tar xzvf yaml-0.1.4.tar.gz
# cd yaml-0.1.4
# ./configure --prefix=/usr/local
# make && make install

Installing Ruby 1.9.3-p194

#  cd /usr/src/
# wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p194.tar.gz
# tar zxvf ruby-1.9.3-p194.tar.gz
# cd ruby-1.9.3-p194
# ./configure --prefix=/usr/local --disable-install-doc --with-opt-dir=/usr/local/lib
# make && make install
# gem install bundler

Optional Update passenger

# gem install passenger
# passenger-install-apache2-module

vi /etc/httpd/conf.d/passenger.conf

LoadModule passenger_module /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.17
PassengerRuby /usr/local/bin/ruby

Install Redmine 2.1

# cd /opt
# svn co http://redmine.rubyforge.org/svn/branches/2.1-stable redmine-2.1
# cd /opt/redmine-2.1
# bundle install --without development test postgresql sqlite rmagick

# cd /opt/redmine-2.1
# chown -R root:root .
# mkdir public/plugin_assets
# chown -R apache:apache files log tmp public/plugin_assets
# chmod -R 755 files log tmp public/plugin_assets
# chown -R apache:apache config/environment.rb

# rake generate_secret_token
# rake db:migrate RAILS_ENV=production
# rake redmine:plugins:migrate RAILS_ENV=production
# rake tmp:cache:clear
# rake tmp:sessions:clear
# touch tmp/restart.txt

vi config/database.yml
change:
adapter: mysql
to:
adapter: mysql2

vi /etc/httpd/conf/httpd.conf

DocumentRoot "/opt/redmine-2.1/public"

Optional Install plugin

# cd /opt/redmine-2.1/plugins
# git clone https://github.com/undx/redmine_redirect_to_after_login.git redirect_to_after_login
# git clone https://github.com/f0y/redmine-wiking.git wiking
# cd /opt/redmine-2.1
# rake redmine:plugins:assets RAILS_ENV=production

Patch

Can’t edit update of an issue http://www.redmine.org/issues/12076
vi /usr/local/lib/ruby/gems/1.8/gems/actionpack-3.2.8/lib/action_dispatch/http/mime_negotiation.rb
change
Array(Mime[parameters[:format]])
to
Array.wrap(Mime[parameters[:format]])

Categories: Redmine Tags: