Perhaps you know redmine ported in FreeBSD and first of all I tried to install it:
#cd /usr/ports/www/redmine
===> redmine-1.2.1_1 is marked as broken: Does not work with RubyGems 1.8.
*** Error code 1
Stop in /usr/ports/www/redmine.
Sure. You wouldn’t read this post if process had been done successfully
Maintainer of this port marked this port as broken because of bug in Gem 1.8.
As result we have to install it manually. Hopefully we have official installation guide.
I came across with some problems during installation. So, this post will be a guide adapted for FreeBSD with some errors and solutions.
Hope it will be useful. It seems as long process, but really easy. Let’s start.
1) Get Redmine (I used svn for it):
#svn co http://redmine.rubyforge.org/svn/branches/1.2-stable redmine-1.2
2) Create database:
mysql -uuser -ppasword
mysql> create database redmine character set utf8;
mysql> create user 'redmine'@'localhost' identified by 'passforuser';
mysql> grant all privileges on redmine.* to 'redmine'@'localhost';
mysql>exit;
3) Database configuration (copy from config/database.yml.example). config/database.yml:
production:
adapter: mysql
database: redmine
host: localhost
username: redmine
password: passforuser
4)Generate a session store secret.
#rake generate_session_store
Missing the i18n 0.4.2 gem. Please `gem install -v=0.4.2 i18n`
At this place started problems. Don’t worry. Just do thing redmine suggests.
#gem install -v=0.4.2 i18n
Fetching: i18n-0.4.2.gem (100%)
Successfully installed i18n-0.4.2
1 gem installed
Installing ri documentation for i18n-0.4.2...
Installing RDoc documentation for i18n-0.4.2...
trying again:
#rake generate_session_store
Missing the Rails 2.3.11 gem. Please `gem install -v=2.3.11 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
I tried update RAILS_GEM_VERSION (on 3.0.5) but Redmine doesn’t work with 3.0.5 yet, so:
# gem install -v=2.3.11 rails
then again:
# rake generate_session_store
rake/rdoctask is deprecated. Use rdoc/task instead (in RDoc 2.4.2+)
WARNING: 'task :t, arg, :needs => [deps]' is deprecated. Please use 'task :t, [args] => [deps]' instead.
at /vol1/www/www.slim/httdocs/redmine/redmine-1.2/lib/tasks/email.rake:170
Googled the problem and found out it connected with rake version (need to downgrade):
# gem install -v=0.8.7 rake
Fetching: rake-0.8.7.gem (100%)
Successfully installed rake-0.8.7
1 gem installed
Installing ri documentation for rake-0.8.7...
Installing RDoc documentation for rake-0.8.7...
# gem uninstall -v=0.9.2 rake
Successfully uninstalled rake-0.9.2
finally it done:
# rake generate_session_store
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)
5) Database migration:
# rake db:migrate RAILS_ENV=production
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)
rake aborted!
syntax error on line 8, col 2: ` encoding: utf8'
(See full trace by running task with --trace)
Problem was – I missed space in config/database.yml before the password.
# rake db:migrate RAILS_ENV=production
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)
!!! The bundled mysql.rb driver has been removed from Rails 2.2. Please install the mysql gem and try again: gem install mysql.
rake aborted!
no such file to load -- mysql
installing gem mysql:
howtobsd# gem install mysql
and then:
howtobsd# rake db:migrate RAILS_ENV=production
db migration done!
6) Load default data (recommended):
# rake redmine:load_default_data RAILS_ENV=production
(in /vol1/www/www.slim/httdocs/redmine/redmine-1.2)
Select language: bg, bs, ca, cs, da, de, el, en, en-GB, es, eu, fa, fi, fr, gl, he, hr, hu, id, it, ja, ko, lt, lv, mk, mn, nl, no, pl, pt, pt-BR, ro, ru, sk, sl, sr, sr-YU, sv, th, tr, uk, vi, zh, zh-TW [en]
Choose language and moving ahead.
7)According to manual set permissions (create required folders if it doesn’t exist):
chown -R username:username files log tmp public/plugin_assets
chmod -R 755 files log tmp public/plugin_assets
8) Test installation:
#ruby script/server webrick -e production
=> Booting WEBrick
=> Rails 2.3.11 application starting on http://0.0.0.0:3000
now you can enter in your browser http://localhost:3000
* login: admin
* password: admin
Great! It is works!
9) We only need to configure Apache for redmine.
It is described in my article “Installing Ruby on Rails on FreeBSD” with differences in httpd.conf for new versions.
Now for me it:
LoadModule passenger_module /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.5
PassengerRuby /usr/local/bin/ruby18
10)My example of virtual host for redmine:
<VirtualHost *:80>
ServerName my-projects.com
DocumentRoot /vol1/www/www.slim/httdocs/redmine/redmine-1.2/public/
RailsEnv production
ErrorLog /vol1/www/www.slim/httdocs/redmine/redmine-1.2/log/httpd.log
</VirtualHost>
That’s all!
Posted on October 22nd, 2011 by admin
Filed under: Software | 4 Comments »