ITPub博客

首页 > Linux操作系统 > Linux操作系统 > redmine3.3安装笔记

redmine3.3安装笔记

原创 Linux操作系统 作者:e71hao 时间:2016-11-11 10:50:48 0 删除 编辑
    本笔记是记录redmine在linux centos6.8 x86_64下的安装过程。redmine 是ruby写的项目管理工具,中间需要用到web服务器webrick,其中webrick在redmine已经有了,另外需要安装的是mysql、ruby、bundler。

     1.在官网下载redmine3.3.1到linux下。解压后目录:
[root@wiki redmine-3.3.1]# ls
app           bin     config.ru        db   extra  Gemfile       lib  plugins  Rakefile     script  tmp
appveyor.yml  config  CONTRIBUTING.md  doc  files  Gemfile.lock  log  public   README.rdoc  test    vendor

    2.查看安装文件install  ,$redmine_home/doc/install文件:

点击(此处)折叠或打开

  1. == Redmine installation
  2. Redmine - project management software
  3. Copyright (C) 2006-2016 Jean-Philippe Lang
  4. http://www.redmine.org/
  5. == Requirements
  6. * Ruby >= 1.9.3
  7. * RubyGems
  8. * Bundler >= 1.5.0
  9. * A database:
  10.   * MySQL (tested with MySQL 5.1)
  11.   * PostgreSQL (tested with PostgreSQL 9.1)
  12.   * SQLite3 (tested with SQLite 3.7)
  13.   * SQLServer (tested with SQLServer 2012)
  14. Optional:
  15. * SCM binaries (e.g. svn, git...), for repository browsing (must be
  16.   available in PATH)
  17. * ImageMagick (to enable Gantt export to png images)
告诉我们,至少要ruby1.9版本以上,mysql5.1以上。ruby1.9以上gem.
rubygems,bundler是ruby的打包安装器,类似rpm和yum。

3.安装ruby ,请网上百度搜索关键字:“ruby 2.2 安装”。这里我只说下重点:ruby安装有依赖包,请先安装ruby依赖包,否则会出现如下错误:
  1. ERROR:  Loading command: install (LoadError)  
  2. no such file to load — zlib  
  3. ERROR:  While executing gem … (NameError)  
  4. uninitialized constant Gem::Commands::InstallCommand 

4.ruby 安装好后,有个源要更改,否则gem 安装东西的时候,特别慢。gem是什么玩意?就是从远程服务器搜索ruby包,下载本地安装的工具,类似yum,rpm。
 gem sources --add http://gems.ruby-china.org/ --remove https://rubygems.org/  

5.ruby安装好后,安装bundler. bundler的官网是http://bundler.io/




==================分割线=======================
以上软件都准备好之后,可以按照install,往下安装。
以下是摘录redmine软件解压,找到安装文件install:
3. Configure the database parameters in config/database.yml
在config中copy一份database.yml.example,然后根据情况更改。

点击(此处)折叠或打开

  1.   production:
  2.   adapter: mysql2
  3.   database: redmine
  4.   host: localhost
  5.   username: redmine
  6.   password: "redmine123"
  7.   encoding: utf8
在这里,你可能会疑惑mysql2是什么意思?其实这是ruby连接mysql的一种驱动程序。如下
[root@wiki config]# gem list |grep mysql
mysql2 (0.4.5, 0.3.21)
验证:你需要在本地验证测试一下,看看能不能连接上数据库,mysql -uredmine  -predmine123.
4. Install the required gems by running:
     bundle install --without development test
在这个步骤,你会看到bundle 在刷刷的安装程序,把相互依赖的程序都安装了,类似yum,类似perl的cpanm。是不是很爽?
你还会看到,ruby通过mysql2连接程序连接到mysql数据库,然后插入了很多表,很多数据。看下都有哪些表:

点击(此处)折叠或打开

  1. mysql> show tables;
  2. +-------------------------------------+
  3. | Tables_in_redmine |
  4. +-------------------------------------+
  5. | attachments |
  6. | auth_sources |
  7. | boards |
  8. | changes |
  9. | changeset_parents |
  10. | changesets |
  11. | changesets_issues |
  12. | comments |
  13. | custom_field_enumerations |
  14. | custom_fields |
  15. | custom_fields_projects |
  16. | custom_fields_roles |
  17. | custom_fields_trackers |
  18. | custom_values |
  19. | documents |
  20. | email_addresses |
  21. | enabled_modules |
  22. | enumerations |
  23. | groups_users |
  24. | import_items |
  25. | imports |
  26. | issue_categories |
  27. | issue_relations |
  28. | issue_statuses |
  29. | issues |
  30. | journal_details |
  31. | journals |
  32. | member_roles |
  33. | members |
  34. | messages |
  35. | news |


5. Generate a session store secret
  bundle exec rake generate_secret_token
在这个步骤我报错,不过我忽略了
7. Setting up permissions (Windows users have to skip this section)
我跳过,因为我全部都是在root下执行
8. Test the installation by running the WEBrick web server
   
   Under the main application directory run:
     ruby bin/rails server -e production
在这个步骤,请在redmine的安装目录下执行。就是ruby启动了自动的web服务器:webrick,可以看到,这个werick只是绑定在127.0.0.1 IP上监听的,其他机器访问不到,需要把上面命令稍微改造下:
 nohup ruby bin/rails server -e production --binding=172.16.0.200  &
加参数--binding
好啦,大功告成,用浏览器登录看看:


最后在总结下:redmine是用ruby写的,不熟悉ruby的朋友 ,能花个半天时间熟悉ruby,gem,bundler,安装定能事半功倍。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30393770/viewspace-2128287/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-08-05

  • 博文量
    133
  • 访问量
    235560