Home > MySQL, redmine, ubuntu > Install redmine with MySQL in Ubuntu 11.04

Install redmine with MySQL in Ubuntu 11.04

Damaged hard disk, new hard disk, new re-installation of my software!

Based on my previous post (https://myotragusbalearicus.wordpress.com/2011/03/22/install-redmine-with-mysql-in-ubuntu-10-10/), I reinstalled redmine on Ubuntu 11.04. I also tried to follow http://www.x2on.de/2011/04/23/tutorial-redmine-with-git-and-gitosis-on-ubuntu-11-04/ without installing Git, but have had a lot of problems.

First, install the required packages (Ruby on Rails), apache modules, and then install redmine:

$ sudo apt-get install ruby rubygems subversion ruby-pkg-tools ruby1.8-dev build-essential apache2-prefork-dev libapache-dbi-perl libapache2-mod-perl2 libdigest-sha1-perl libcurl4-openssl-dev ruby  ruby1.9.1-dev libgemplugin-ruby libgemplugin-ruby1.8 libruby-extras libruby1.8-extras rake libmysqlclient15-dev
$ sudo apt-get install libapache2-mod-passenger
$ sudo apt-get install redmine redmine-mysql

If you like Gantt-charts:

$ sudo apt-get install librmagick-ruby1.8

Create the database for redmine:

$ mysql -u root -p
CREATE DATABASE redmine CHARACTER SET utf8;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'redmine_password';
GRANT ALL privileges ON redmine.* TO 'redmine'@'localhost';

Configure the database settings:

$ cd /usr/share/redmine
$ sudo cp templates/database.yml.template config/database.yml
$ sudo vi config/database.yml

Sample config file using the default MySQL port (3306):

production:
  adapter: mysql
  database: redmine
  host: localhost
  username: redmine
  password: redmine_password
  encoding: utf8

Install Rubygem, because Ubuntu 11.04 has an older version:

$ cd /tmp
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.7.2.tgz
$ tar xvfz rubygems-1.7.2.tgz
$ cd rubygems-1.7.2
$ sudo mv /usr/bin/gem /usr/bin/gem-ubuntu
$ sudo ruby setup.rb
RubyGems 1.7.2 installed

=== 1.7.2 / 2011-04-05

* 1 Bug Fix:
  * Warn on loading bad spec array values (ntlm-http gem has nil in its cert
    chain)

------------------------------------------------------------------------------

RubyGems installed the following executables:
	/usr/bin/gem1.8
$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

Now install Rails and rack

$ sudo gem install rails -v=2.3.11
$ sudo gem install rack -v=1.1.0
$ sudo gem install mysql
$ sudo gem install -v=0.4.2 i18n

Configure redmine:

$ cd /var/www
$ sudo ln -s /usr/share/redmine/public /var/www/redmine
$ sudo chown -R www-data:www-data redmine
$ sudo rake generate_session_store

If you get this error…

rake aborted!
no rakefile found

…just go to the redmine folder and run again… to get this new error:

$ cd /usr/share/redmine
$ sudo rake generate_session_store
NOTE: SourceIndex.new(hash) is deprecated; From /usr/share/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
rake/rdoctask is deprecated.  Use rdoc/task instead (in RDoc 2.4.2+)
rake aborted!
uninitialized constant ActiveSupport::Dependencies::Mutex

As stated in Redmine forums http://www.redmine.org/boards/1/topics/22314, i added this line at the beggining of /usr/share/redmine/config/boot.rb:

require 'thread'

And now…

$ sudo rake generate_session_store
NOTE: SourceIndex.new(hash) is deprecated; From /usr/share/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
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 /usr/share/redmine/lib/tasks/email.rake:170

But this is only a warning, so you can safeliy ignore it.

Let’s go with the next step:

$ sudo RAILS_ENV=production rake db:migrate
NOTE: SourceIndex.new(hash) is deprecated; From /usr/share/redmine/config/../vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100:in `new'.
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 /usr/share/redmine/lib/tasks/email.rake:170
<strong>rake aborted!</strong>
undefined local variable or method `version_requirements' for #<Rails::GemDependency:0x7f9ea62268b0>

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

That seems to be due to incompatible version of rubygems:

$ gem list

*** LOCAL GEMS ***

actionmailer (2.3.11)
actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
i18n (0.4.2)
mysql (2.8.1)
rack (1.1.2, 1.1.0)
rails (2.3.11)
rake (0.9.2)

$ rails -v
Rails 2.3.11

$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

Install rubygems update 1.4.2 (and uninstall any other rubygems version you already have):

$ sudo gem install rubygems-update -v='1.4.2'
$ sudo update_rubygems

To get another error…

$ sudo RAILS_ENV=production rake db:migrate
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 /usr/share/redmine/lib/tasks/email.rake:170
rake aborted!
No such file or directory - /etc/redmine/default/database.yml

This is more simple!

$ cd /etc/redmine/default
$ sudo ln -s /usr/share/redmine/config/database.yml

And now you finally can configure it:

$ cd /usr/share/redmine
$ sudo RAILS_ENV=production rake db:migrate
$ sudo RAILS_ENV=production rake redmine:load_default_data

And you can test redmine at

http://localhost/redmine

Wow, a little more complicated than in 10.10, at least for me!

Updated 05/april/2012

As commented @ilian, if you have this error:


Please install RDoc 2.4.2+ to generate documentation.

Install it:


gem install rdoc -v=2.4.2

Categories: MySQL, redmine, ubuntu Tags: , , , ,
  1. Sienna Lai
    May 4, 2014 at 7:45

    Hi!

    Just got it installed onto Ubuntu 12.04, but I only get the directory listing. Everything seems to have installed ok, just wont start up.

    Any Ideas?

    Much Thx

    Sienna

    Like

    • May 5, 2014 at 22:41

      Hi Sienna, that also happened to me. Check your /etc/apache2/sites-available/redmine to be like this:

      RailsEnv production
      RailsBaseURI /redmine
      Options -MultiViews

      and make sure you have a symlink on /var/www/redmine to /usr/share/redmine/public

      Like

  2. ayoub
    December 23, 2012 at 1:58

    thanks so much

    Like

  3. October 8, 2012 at 18:19

    Hi!

    i am trying to install on Ubuntu 12.04 but i only get the directory listing.
    In the database i can see the redmine tables though.

    Any thoughts?

    Like

  4. Fred
    September 11, 2012 at 16:55

    I followed all the steps but when I go to http://localhost/redmine , I just get the directory listing. What am I doing wrong?

    Like

    • September 13, 2012 at 13:05

      Hi Fred, which version of Ubuntu are you running?
      I reproduced your behavior but on ubuntu 11.10 from scratch, so this tutorial is not valid for ubuntu 11.10. In my case the database is not being populated with the redmine tables.

      Like

  5. July 12, 2012 at 15:37

    Wow, this works. Thank you!!!

    Like

  6. conscience
    April 18, 2012 at 21:11

    gem install rdoc -v=2.4.2
    Not worked for me … the message “Please install RDoc 2.4.2+ to generate documentation” still shows up when I want to run “rake generate_session_store”

    What can i do ?

    Like

    • April 23, 2012 at 12:40

      Hi @conscience, sorry for the delay.

      Which version of ubuntu are you using? Also, post the output of this commands:
      gem list
      rails -v
      ruby -v

      Like

  7. April 5, 2012 at 20:13

    And to complete the manual for those who do not use Apache server for redmine. The nginx minal host configuration will be:

    cat /usr/local/nginx/conf/sites-available/your.host.name.conf

    server {
    listen 80;
    server_name your.host.name;
    access_log /var/log/nginx/helpdesk_access.log;

    location / {
    proxy_pass http://127.0.0.1:3000/;
    proxy_set_header Host $host;
    }

    }

    Like

    • April 6, 2012 at 9:45

      Thanks again @ilan for your comments!

      Like

  8. April 4, 2012 at 15:09

    Thanks a lot!
    I needed one more thing to do. I had message: Please install RDoc 2.4.2+ to generate documentation. So i needed

    gem install rdoc -v=2.4.2

    Like

    • April 5, 2012 at 19:42

      Thanks for your input @ilan. I’ve updated the post

      Like

  9. steffy
    January 11, 2012 at 2:35

    Thanks bro . . . LifeSaver !!!
    😀

    Like

  10. November 9, 2011 at 20:54

    Thanks, all work 🙂

    Like

  11. Tom
    September 27, 2011 at 21:27

    Thanks for your write-up, it helped me a lot :-).

    Like

  12. September 15, 2011 at 17:17

    I’ve same error but it doesn’t solve the “require ‘thread'” on debian squeeze.

    Thanks any way for your contribution 🙂

    Like

    • September 16, 2011 at 12:49

      Hola Alberto,
      Do you get the same error message than me?
      uninitialized constant ActiveSupport::Dependencies::Mutex

      Can you post the otuput of ‘gem list’?

      Like

  1. September 6, 2011 at 9:26

Leave a comment