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
mysql2gem: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_tokenHighlighting this because it’s the issue: it complains it can’t find mysql2.so
-
Things I already tried that didn’t work:
- Even though that file is definitely right there on disk.
- Downloaded
libmysql.dllfrom the official MySQL site and put it into Ruby’sbindirectory—no luck. - Tried using
mysqlinstead ofmysql2—same error saying it couldn’t find the package. - 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.
-
在的项目组用redmine看着很不错。凑巧自己带的团队也需要一个项目管理的软件,就查了资料准备自己搭建一个。
-
环境,win2003 RC2
-
使用一键安装很顺利,自带apache mysql ruby rails 跑起来也没多大问题。
-
但是服务器上已经有装好的mysql 和apahce 就想着折腾下倒腾到一块吧。
-
redmine 用的2.4.2 mysql 5.5 ruby 1.9.3 rails 4.0.2 装ruby rails 实在是麻烦,还是依赖了railsinstaller。一键安装,测试安装的方法
cmd rails -v ruby -v -
能看到版本号就ok了。
-
安装ruby能用的mysql 驱动。因为我用的mysql 5.5 和ruby 1.9.3 用到了mysql2的包
gem install mysql2 -- --with-mysql-dir="your mysql directory" 例如我的mysql 是用的xampp包 就会是 gem install mysql2 -- --'with-mysql-dir="D:\xampp\mysql"' -
然后切到redmine 的目录做bundle 安装。
gem install bundler bundle install without development test sqlite postgresql -
一般来说问题来了
做session rake generate_secret_token因为是问题所以突出,提示找不到mysql2.so包
-
已经试验过没有的办法
- 而这个文件确确实实是能找得到的。
- 找mysql 官网上的libmysq.dll加入到ruby 的bin 中,无效
- 使用mysql 而不是mysql2 同样提示找不到这个包。
- 给svn配了环境变量也不行。
实在不行还是用了一键安装,但是svn因为是https的问题又无法check out
网上找的方法
1. 打开cmd , 输入:
cd <%redmine所在文件夹%>
svn --config-dir webserverRedmine co https://<目标SVN地址> <文件夹名>(文件夹名随意,该文件夹会生成在cmd的当前工作目录,是从svn服务器上同步下来的内容,可以删除)。
命令输入完成后,会出现提示,输入svn用户名和密码,然后又提示:“是否永久保存ssl凭证?”输入p确定。
此时会在redmine所在文件夹下生成webserverRedmine目录,目录内容为该SVN的ssl凭证。
2. 修改<%redmine所在文件夹%>\lib\redmine\scm\adapters\文件夹下subversion_adapter.rb的内容。
修改为:
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所在文件夹\""
//(注意:路径最后的文件夹不要加斜杠)
str
end
- 会让整个链接断开,整个网站都出现server time out
- 确实这样一个下午和晚上就过去了。待续。