Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a redmine setup. today morning I saw that my redmine folder was empty and I was unable to access redmine, so I tried installing redmine again using:

sudo apt-get install redmine

I am getting the following error:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
  redmine: Depends: ruby-rails-2.3 (>= 2.3.14) but it is not going to be installed or rails (>= 2.3.14) but it is not going to be installed

How can I reinstall redmine?

share|improve this question
    
Also could you add output of apt-cache policy ruby-rails-3.2 to your question? –  oerdnj Mar 19 '13 at 19:48

2 Answers 2

Actually Redmine has its own step by step installation.

First of all if you have some data on your mysql, make a backup $ mysqldump -u root -p redmine > redmine.sql

if not, then you can follow up this instructions:

Pre-install

Set the timezone

dpkg-reconfigure tzdata

Select your timezone and exit.

Set your hostname

sudo nano /etc/hostname

Enter your server name and save.

redmine

Map your fully qualified domain name (FQDN) to localhost

sudo nano /etc/hosts

Add a line mapping local host to your FQDN and hostname and save. eg.

127.0.0.1 redmine.domain.com redmine

Redmine Installation

Install the LAMP stack

sudo tasksel install lamp-server

Install the required packages

sudo apt-get install build-essential subversion libmysqlclient15-dev libdigest-sha1-perl libgemplugin-ruby libgemplugin-ruby1.8 libruby-extras libruby1.8-extras rails rake ruby rubygems rubygems1.8 ruby1.8-dev libopenssl-ruby1.8 

Install the required Ruby gems

sudo gem install rails -v=2.3.14 --no-ri --no-rdoc
sudo gem install rake -v=0.8.7 --no-ri --no-rdoc
sudo gem uninstall rake -v=0.9.2.2 
sudo gem install i18n -v=0.4.2 --no-ri --no-rdoc
sudo gem install mysql --no-ri --no-rdoc

Download Redmine into /user/share/redmine directory

sudo svn co http://redmine.rubyforge.org/svn/branches/1.3-stable /usr/share/redmine

Create an empty MySQL database and accompanying user named redmine for example.

$ mysql -u root -p
(enter the mysql root user password)
> create database redmine character set utf8;
> create user 'redmine'@'localhost' identified by '[password]';
> grant all privileges on redmine.* to 'redmine'@'localhost' identified by '[password]';
> exit

Copy config/database.yml.example to config/database.yml and edit this file in order to configure your database settings for "production" environment.

sudo cp /usr/share/redmine/config/database.yml.example /usr/share/redmine/config/database.yml
sudo nano /usr/share/redmine/config/database.yml

Modify according to the following lines and save (ctrl+x)

production:
    adapter: mysql
    socket: /var/run/mysqld/mysqld.sock
    database: redmine
    host: localhost
    username: redmine
    password: [password]
    encoding: utf8

Generate a session store secret.

cd /usr/share/redmine
sudo rake generate_session_store

Create the database structure, by running the following command under the application root directory:

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

Insert default configuration data in database, by running the following command:

sudo RAILS_ENV=production rake redmine:load_default_data

Setting up permissions

cd /usr/share/redmine
sudo chown -R www-data:www-data files log tmp public/plugin_assets

Test using the webrick web server

cd /usr/share/redmine
ruby script/server webrick -e production

Point your web browser at http://[my server ip]:3000

You should now see the application welcome page.

Apache Integration

Install the required packages

sudo apt-get install libapache2-mod-passenger

Add a symbolic link to the public redmine web directory

sudo ln -s /usr/share/redmine/public /var/www/redmine

Configure Passanger to run as www-data

sudo nano /etc/apache2/mods-available/passenger.conf

Add the follow line and save (ctrl+x)

PassengerDefaultUser www-data

Create a new Apache site file

sudo nano /etc/apache2/sites-available/redmine 

Add the following lines and save (ctrl+x)

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www
        ServerName myservername

        RewriteEngine on
        RewriteRule   ^/$  /redmine  [R]

        <Directory /var/www/redmine>
                RailsBaseURI /redmine
                PassengerResolveSymlinksInDocumentRoot on
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Enable the Redmine website

 sudo a2dissite default
 sudo a2ensite redmine

Enable the Passenger and Rewrite modules and restart Apache

 sudo a2enmod passenger
 sudo a2enmod rewrite
 sudo /etc/init.d/apache2 restart

Test the setup

Open up your favorite web browser and go to

http://[my site or ip]/redmine

share|improve this answer
    
It's not necessary to clutter your system with gemhell. There are official Debian/Ubuntu packages available which work fairly well. –  oerdnj Mar 19 '13 at 19:32

Unfortunatelly the official Ubuntu packages are not yet up-to-date (so last version is 1.4.x), because they follow official Debian packages and we were not fast enough to get RoR 3.2 before Debian has been frozen (well it's our own free time and limited resources).

Anyway there's Redmine 2.2.x packages prepared by me available from Debian Experimental and copied to ondrej's Redmine PPA for all supported releases (excluding lucid which has Ruby so old it's impossible to backport it). It might get unstable from time to time, but generally I try to keep the PPA in stable state.

So the recommended solution for you would be to add the ppa using:

sudo add-apt-repository ppa:ondrej/redmine
sudo apt-get update
sudo apt-get install redmine redmine-mysql # or redmine-pgsql

Then you can follow the guide HowTo Install Redmine on Ubuntu step by step or other guides (like HowTo configure Nginx to run Redmine).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.