3

I have not been able to update my redmine. Everytime I ran apt-get upgrade, I'm getting a ruby not found error:

Setting up redmine (2.4.2-1) ...
dbconfig-common: writing config to /etc/dbconfig-common/redmine/instances/default.conf
Creating config file /etc/redmine/default/database.yml.new with new version
dbconfig-common: flushing administrative password
Populating database for redmine instance "default".
This may take a while.
/usr/bin/env: ruby1.8: No such file or directory
Error when running rake db:migrate, check database configuration.
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)

I am stuck now. My redmine has stopped working.

I have tried to "redmine" by linking /usr/bin/ruby1.8 to /usr/bin/ruby, but got stuck with different error.

Setting up redmine (2.4.2-1) ... dbconfig-common: writing config to /etc/dbconfig-common/redmine/instances/default.conf

Creating config file /etc/redmine/default/database.yml.new with new version
dbconfig-common: flushing administrative password
Populating database for redmine instance "default".
This may take a while.
/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
        from /usr/local/bin/rake:18:in `<main>'
Error when running rake db:migrate, check database configuration.
dpkg: error processing package redmine (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 redmine
E: Sub-process /usr/bin/dpkg returned an error code (1)

And then I tried with re-installing ruby1.8 by as suggested in this issue. But I got a different error while installing ruby1.8.

apt-get install ruby1.8
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-sqlite : Depends: ruby-sqlite3 but it is not going to be installed
 ruby-fcgi : Depends: libruby1.9.1 (>= 1.9.2.0) but it is not going to be installed or
                      libruby2.0 (>= 2.0.0) but it is not going to be installed
 ruby-railties-3.2 : Depends: ruby-actionpack-3.2 (>= 3.2.16) but it is not going to be installed
                     Depends: ruby-actionmailer-3.2 (>= 3.2.16) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

2 Answers2

1

The (first) error message shown was:

/usr/bin/env: ruby1.8: No such file or directory

This is trying to run ruby1.8 but there is no such program. Unfortunately, as revealed by a "contents of packages" search, ruby1.8 is no longer provided in Ubuntu 14.04.

Installing ruby1.8 anyway:

You can install ruby1.8 using either of the two methods described in answers to:

Currently there are two answers, one suggesting to enable a software repository from 13.10 to install the old version intended for the preceding release, and the other suggesting to use a (perhaps especially) experimental PPA.

I'm not sure which of the two is better or more reliable. Either one should work.

Attempting to use ruby1.9 as ruby1.8:

Another possibility, suggested/inspired by this answer by tres to that different question on Stack Overflow, is to "fool" redmine's installation script into acting like the later version of ruby (ruby1.9) is ruby1.8. This won't keep ruby1.9 from working for applications that need that version, but it won't necessarily work right either; it is a question of how closely redmine depends on ruby1.8.

To do this, create a symbolic link to ruby (which runs the default version, in this case 1.9) called ruby1.8:

sudo ln -s /usr/bin/ruby /usr/bin/ruby1.8

(Update) If you get Could not find rake (>= 0) amongst [] (Gem::LoadError):

In the updated information added to your answer, you mention symlinking /usr/bin/ruby1.8 to /usr/bin/ruby (to make it use the installed ruby1.9) and getting an error message where the first error was:

/usr/lib/ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find rake (>= 0) amongst [] (Gem::LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
        from /usr/lib/ruby/1.9.1/rubygems.rb:1231:in `gem'
        from /usr/local/bin/rake:18:in `<main>'
Error when running rake db:migrate, check database configuration.

You might be able to fix that error by installing the rake package:

sudo apt-get update
sudo apt-get install rake

If symlinking ruby1.8 to ruby doesn't work you decide to attempt actually installing ruby1.8, you should remove the link first, with sudo rm /usr/bin/ruby1.8.

If you have further problems, please edit your question with details. (Or if you feel the problems are very different from what you've asked about here, you could make a new question.) Good luck.

Eliah Kagan
  • 117,780
  • Actually I have tried all three options. First thing I did was to "fool" redmine by linking ruby 1.8 to ruby. But there were some missing libraries. Then, I tried installing Ruby 1.8 but failed due to dependencies issue. It complained about few dependencies which are no longer there. – Hud Hood Aug 05 '14 at 02:03
  • I have updated the question as suggested with the result of your suggestion. – Hud Hood Aug 05 '14 at 02:30
  • @HudHood Thanks. I've updated this answer with an idea for solving the problem you got when you symlinked ruby1.8 to ruby. Maybe that will help. – Eliah Kagan Aug 05 '14 at 21:43
  • Eliah Kagan, thanks for the updated answer. Since I could not wait for the problem as users were waiting to use redmine, what I did was copied the redmine db to another server, installed redmine on that server, and carry on from there. It is working with all the data intact. I'm sorry, that I'm could not test the solutions given. – Hud Hood Aug 06 '14 at 10:41
  • @HudHood No problem. Since that solution worked (copying another machine's redmine installation), I recommend posting your own answer about it. It may help others in this situation. – Eliah Kagan Aug 06 '14 at 20:47
1

After trying different solutions and failed to get redmine properly installed. I finally got it working on a different machine. And use the following steps.

  • Backup the redmine_default database on mysql and restore it on another machine with the same name
  • Fresh install redmine on the new machine.

    apt-get install redmine redmine-mysql

  • Follow the redmine installation steps from here

The installation/upgrade worked with all my existing data intact.

After a few days, I did another test on the old machine, and found out that by uninstalling redmine and purging it making sure all traces of previous redmine and ruby required removed, reinstalling it again from the beginning, worked!!!

So, if upgrading is a problem, backup the database, uninstall redmine

apt-get remove redmine redmine-mysql
apt-get purge redmine redmine-mysql

Restore the db, and follow the installation above