Set up PostgreSQL-based Redmine in Ubuntu9.10

Source: Internet
Author: User
Tags psql postgres createdb redmine
I checked the required components for installing Redmine and planned to build the database on PostgreSQL. At the same time, I also looked for some ldquo for installing Redmine in Ubuntu; experience on rd

I checked the required components for installing Redmine and planned to build the database on PostgreSQL. At the same time, I also looked for some ldquo for installing Redmine in Ubuntu; experience on rd

Redmine is a popular Open Source project management component recently. It is developed based On Ruby On Rails and supports MySQL, PostgreSQL, and SQLite. In addition to the elements of project management, it also has built-in support for news, Wiki, and SVN.
The above is the introduction to Redmine I saw in the bookstore a few weeks ago. I think that the current project team is not well managed based on Excel and network shared folders, maybe we really need a decent Project Management Specification and management software. When I found Redmine, I felt that this was a good solution. Of course, I am not a project manager, but this does not prevent me from trying it in my own environment. Of course, I have to admit that my knowledge of Ruby and Rails is directly equal to 0.

I checked the required components for installing Redmine and planned to build the database on PostgreSQL. At the same time, I also looked for some experiences on installing Redmine in Ubuntu, and then started my painful installation process. (If you want to install Redmine in Ubuntu 9.10, do not follow the steps below)
Ubuntu Document and Ubuntu Wiki do not provide a guide on how to install Redmine, so I followed the Redmine.org Installation Guide to start my installation.

First, I downloaded the Redmine installation package and decompress it ~ /Directory, and generate ~ /Redmine-0.8.5, if not specifically mentioned, all the next operations are done under this directory.
Then execute the following command to install Ruby and RubyGems.

Sudo apt-get install ruby rubygems

Then, run the following command to install PostgreSQL.

Sudo apt-get install postgresql

After PostgreSQL is installed, the system automatically generates a database superuser named postgres. What we need to do is to use this user to create a super user with the same permissions as it does.
So I typed the following command to create a user named mrbear.

Sudo-u postgres createuser-P

Enter name of role to add: mrbear

Enter password for new role:

Type again:

Shall the new role be a superuser? (Y/n) y

At the same time, every user in PostgreSQL should have a database with the same user name, so we must create this database manually.

Sudo-u postgres createdb mrbear

In addition, I may want to manage my database through a graphical interface, so I installed pgAdmin III.

Sudo apt-get install pgadmin3

After installation, click Application> System Tools> pgAdmin III to start using it.
Next, I will return to the Redmine configuration. I log on to PostgreSQL to create a dedicated database and user name for Redmine.

Psql-U mrbear

Psql (8.4.1)

Type & quot; help & quot; for help.

Mrbear = # create role redmine login encrypted password 'mypassword' noinherit valid until 'infinity ';

Mrbear = # create database redmine with encoding = 'utf8' OWNER = redmine;

Note: The SQL statement must be entered in one line in the terminal window. to wrap a line, you must enter-# line feed to connect to the next line of statements. Otherwise, the SQL statement will not be executed.
Finally, follow the Remine.org Installation Guide to modify my config/database. yml, even if the database is ready for pointing.
After preparing the database, you also need to install the Ruby compiler rake.

Sudo apt-get install rake

Then install libopenssl-ruby for rake compilation.

Sudo apt-get install libopenssl-ruby

So far, everything went smoothly, leaving only the last command to compile and build the database.

Rake -- trace db: migrate RAILS_ENV = & quot; production & quot;

When I thought that the success was coming soon, I did not know where I had to take a heavy punch. As a result, I directly fell out of the field.

Please install the postgresql adapter: gem install activerecord-postgresql-adapter (no such file to load-pg)

The first time I saw this error, I was very calm. I know Ruby on Rails is not bound to the postgresql driver by default, so I followed the prompts to execute

Sudo gem install activerecord-postgresql-adapter

But gem cannot find the so-called activerecord-postgresql-adapter error.
I searched Google, Yahoo, and Baidu. Some people said that postgresql may need to be changed to ipvs, but the result is still wrong.
Some people say that the gem library can be directly obtained locally, and the installation is successful after the gem environment variable is modified, but it feels very troublesome.
Search continues and many people have encountered the same problem as me. rake reports require activerecord-postgresql-adapter, and gem tells you that there is no such thing at all.
I even used any network resources I could use. The language involved English, Chinese, and Japanese. I just found a prompt.
Ruby once used postgres to provide support for PostgreSQL, but now postgres development has been stopped, and PostgreSQL is used to provide access to PostgreSQL. At the same time, pg fixed some problems in ipvs.
However, this is not enough to solve my problem. I tried to install S and ps with gem, but both failed.
Some even suffer from this problem and are forced to choose to replace it with MySQL.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.