Legacy Archive (2014): Originally written in Chinese on doubixie.com and translated into English for this edition. All archive posts · Home

Redmine Installation Notes

Original Chinese title: redmine 安装手记

  • I saw the other project team using Redmine and it looked pretty great. Coincidentally, the team I lead also needed project management software, so I looked up some docs and decided to set one up myself.

  • Environment: Win2003 RC2

  • Using the one-click installer went very smoothly—it comes bundled with Apache, MySQL, Ruby, and Rails, and ran without much trouble.

  • However, the server already had MySQL and Apache installed, so I thought I’d tinker a bit and integrate everything together.

  • Redmine version was 2.4.2, MySQL 5.5, Ruby 1.9.3, Rails 4.0.2. Installing Ruby and Rails manually is really a hassle, so I still relied on RailsInstaller. One-click install, and here’s how to verify the installation:

    cmd
    rails -v
    ruby -v
  • As long as you can see the version numbers, you’re good.

  • Install the MySQL driver for Ruby. Since I’m using MySQL 5.5 and Ruby 1.9.3, I needed the mysql2 gem:

    gem install mysql2 -- --with-mysql-dir="your mysql directory"
    For example, my MySQL came from the XAMPP package,
    so it would be: gem install mysql2 -- --'with-mysql-dir="D:\xampp\mysql"'
  • Then switch to the Redmine directory and run bundle install:

    gem install bundler
    bundle install without development test sqlite postgresql 
  • Usually, here’s where the trouble starts:

    Generate session
    rake generate_secret_token

    Highlighting this because it’s the issue: it complains it can’t find mysql2.so

  • Things I already tried that didn’t work:

    1. Even though that file is definitely right there on disk.
    2. Downloaded libmysql.dll from the official MySQL site and put it into Ruby’s bin directory—no luck.
    3. Tried using mysql instead of mysql2—same error saying it couldn’t find the package.
    4. Configured environment variables for SVN—still didn’t work.

Ended up going back to the one-click installer, only to hit another snag: SVN couldn’t check out over HTTPS

Found this workaround online:

1. Open cmd and enter:
cd <%redmine_folder%>
svn --config-dir webserverRedmine co https://<target_SVN_URL> <folder_name> (any folder name works; it will be created in cmd's current working directory with synced content from the SVN server, and can be deleted afterward).
After running the command, you'll be prompted for your SVN username and password, and then asked: "Permanently store SSL credentials?" Enter p to confirm.
This creates a webserverRedmine directory inside the Redmine folder containing the SSL credentials for that SVN repo.

2. Edit subversion_adapter.rb under <%redmine_folder%>\lib\redmine\scm\adapters\
    Change it to:
    def credentials_string 

    str = '' 

    str << " --username #{shell_quote(@login)}" unless @login.blank? 

    str << " --password #{shell_quote(@password)}" unless @login.blank? || @password.blank? 

    str << " --trust-server-cert --no-auth-cache --non-interactive --config-dir \"redmine_folder\""  
    //(Note: do not include a trailing slash on the folder path) 

    str 

    end 
  • That ended up breaking the whole connection, causing the entire site to throw a server timeout.
  • And just like that, an entire afternoon and evening were gone. To be continued.