production:
adapter: mysql2
database: bitnami_redmine
host: 127.0.0.1
username: root
password: ""
port: 3307
encoding: utf8
socket: /home/hyadmin/redmin/mysql/tmp/mysql.sock
development:
adapter: mysql2
database: redmine_development
host: localhost
username: root
password: ""
encoding: utf8
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
database: redmine_test
host: localhost
username: root
password: ""
encoding: utf8
2. 进入如下目录
cd 安装目录/redmin/apps/redmine/htdocs/script
3. 执行如下命令,进入ruby
./rails console production
4. 取得你要修改的用户对象(ruby>代表进入ruby环境)
ruby>admin_user = User.find_by_login('你要改的用户名')
5.修改admin用户对象密码
ruby>admin_user.password = '你的密码'
注: 这个密码不能太短,否则报错。
6.保存admin用户对象信息
ruby>admin_user.save!
7.退出ruby环境
ruby>quit
这样应该就可以用yourpassword这个新密码登录系统了
如果通过上面方法安装DevKit成功率会比较高,下面这种方法不一定能成。但如果你想折腾,可以来试试下面的手动安装。windows下安装或升级时gem经常会碰到
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
这是因为没有安装DevKit的缘故。
DevKit 是windows平台下编译和使用本地C/C++扩展包的工具。它就是用来模拟Linux平台下的make, gcc, sh来进行编译。注:这个方法目前仅支持通过RubyInstaller安装的Ruby,如果不是建议你重新安装。安装方法:双击下载的7z文件,指定解压路径,路径中不能有空格。如C:\DevKit,这个路径就是<DEVKIT_INSTALL_DIR>。
>cd <DEVKIT_INSTALL_DIR>
>ruby dk.rb init
#生成config.yml,这里会检查将要添加DevKit支持的Ruby列表,只支持通过RubyInstaller安装的Ruby
#如果这里列出的Ruby与你的要求不符,可以手动修改
>ruby dk.rb review #检查要添加DevKit支持的Ruby列表是否有误,可以略过
>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby192'
[INFO] Installing 'C:/Ruby192/lib/ruby/site_ruby/devkit.rb'
检查是否安装成功
>gem install rdiscount --platform=ruby
Fetching: rdiscount-1.6.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed rdiscount-1.6.8
1 gem installed
Installing ri documentation for rdiscount-1.6.8...
Installing RDoc documentation for rdiscount-1.6.8...
如果能安装rdiscount成功说明安装DevKit成功。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)