CentOS下使用rbenv安装ruby开发环境,并部署redmine
1.安装依赖
sudo yum install -y git-core zlib zlib-devel gcc-c++ patch readline\ readline-devel libyaml-devel libffi-devel openssl-devel make\ bzip2 autoconf automake libtool bison curl sqlite-devel sudo yum install -y ImageMagick-devel
2.安装rbenv,不要使用root用户
1 cd 2 git clone git://github.com/sstephenson/rbenv.git .rbenv 3 echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile 4 echo 'eval "$(rbenv init -)"' >> ~/.bash_profile 5 6 git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build 7 echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bash_profile
3.安装ruby
rbenv install 2.5.7 rbenv global 2.5.7 rbenv versions #已安装的版本 rbenv install --list #查看可安装的版本列表 rbenv rehash # 每当切换 ruby 版本和执行 bundle install 之后必须执行这个命令 echo "gem: --no-document" > ~/.gemrc #禁用Rubygems为安装的每个gem生成本地文档
echo "gem: --no-ri --no-rdoc" > ~/.gemrc gem install bundler # 安装bundler
4.安装redmine
去官网下载最新版本的redmine压缩包,解压并进入目录
bundle install #安装依赖gems rake generate_secret_token # 生成存储秘钥 # 重命名databases.yml文件并配置数据库 rake db:migrate RAILS_ENV="production" # 生成数据表 # 启动命令 ruby bin/rails server -b 0.0.0.0 -p 3000 webrick -e development # admin默认密码admin
5.windows系统安装ruby环境中相关问题
https://rubyinstaller.org/downloads/
下载rubyinstaller,注意32位和64位,傻瓜式安装就好了
在windows上redmine的安装依赖时可能会报错,解决方案如下
https://www.redmine.org/projects/redmine/wiki/HowTo_install_rmagick_gem_on_Windows