初次安装Redmine(其他事情也要这样稳扎稳打),不免有很多出错的地方,对于新手来说,因为本身并不懂这一步步的操作的根据,只是在跟着网上教程做,与其花费太多时间去排错,不如多恢复两次节省时间。比恢复磁盘更节省时间的方法就是做好快照,例如:初始化的快照一个,避免需要磁盘初始化花费太多时间;某个上次出错的操作这次解决了,也做一个快照,万一需要恢复的时候,从这一时刻恢复即可。
因为系统、软件的更新,没有尽善尽美的教程,只有多思考,多比较,更有益于解决问题。
Because of the Great Firewall,the most important thing is changing your downloading source in case you spend unnecessary time on downloading software.No matter which way you use,such as gem,bundle,rvm.
因为“长城防火墙”的缘故,为了避免你在下载软件的时候花费不必要的时间,最重要的就是修改你使用的下载源,不管你用的哪种方式下载,比如,gem,bundle,rvm。
Reference:https://ruby.taobao.org/在CentOS上部署Redmine过程中,在安装Rails时
#gem install rails
总是报错。
错误: Failed to build gem native extension
这是我遇到的问题中报错的一项,最后通过以下方法得到了解决,所以贴出来分享下。我不知道为什么这样做,只是在不断尝试中发现终于不报错了。-_-|
对策:
for ubuntu:sudo apt-get install zlib1g-dev
for Redhat or CentOs
sudo yum install zlib-devel -y
From Builds failing with “zlib is missing; necessary for building libxml2”
在安装MySQL时
#gem install mysql
总是报错。
错误: Failed to build gem native extensionOn
Ubuntu/Debian and other distributions using aptitude
sudo apt-get install libmysql-ruby libmysqlclient-dev
If the above command doesn’t work because libmysql-ruby cannot be found, the following should be sufficient:
sudo apt-get install libmysqlclient-devOn Red Hat/CentOS and other distributions using yum:
sudo yum install mysql-devel
On Mac OS X with Homebrew:
brew install mysql
FROM StackOverFlowERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)
http://support.moonpoint.com/software/database/mysql/not-running-centos7.php
关键是启动服务时用
systemctl start mariadb.service
用systemctl start mysqlb.service
会报错,原因是现在的CentOS默认的MySQL都是安装Maria数据库,in a word,自从用了Maria数据库,一切都不是原来的模样。Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES section: ‘nokogiri’(或者是其他的section)
rv Gemfile.lock
忘了问题 :(
Try adding this line to your Gemfile
gem 'rack', '~> 1.6.4'
and then run:
bundle install
and see if that fixes your issue.
Update
If the above does not work, try uninstalling railties gem. Then install an older version of the rails (rails version 4.0.0 was used in the from the tutorial). The issue is due to the version mismatch/incompatibility of some of your gems.yum install rvm failed && How to install rvm
(1)Before any other step install mpapis public key (might need gpg2) (see security)
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
(2)Install RVM (development version):
\curl -sSL https://get.rvm.io | bash
FROM Installing RVM/usr/local/rvm/gems/ruby-2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: key “inodot” is duplicated and overwritten on line 466
(1)vi /usr/local/rvm/gems/ruby-2.3.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb
(2)按下Esc,输入 冒号 ,:set number
(3)找到第466行,把它用井号“#”注释掉原因可能是你曾经安装过一次ruby
启动redmine
ruby bin/rails server webrick -e production -b 42.96.137.217 -d
参数说明:
-b 绑定ip。例如我的IP:42.96.137.217
-d 后台运行。
-e 指定默认配置文件。
rails server -h 可以获取更多的帮助。
参考:
(1)centos 安装 redmine 2.6.0.stable 强烈推荐
(2)Centos6.6下安装配置Redmine详解