一、设置环境变量
进入redmine安装目录下,执行:
export RAILS_ENV="production" #(linux)
set RAILS_ENV=production #(windows)
二、创建插件
bundle exec ruby bin/rails generate redmine_plugin <plugin_name>
然后在plugins文件夹下可以看到生成了一个 以上面你的
三、编辑插件信息
打开 plugins/
四、创建model
1.使用命令创建
bundle exec ruby bin/rails generate redmine_plugin_model <plugin_name> testvote question:string yes:integer no:integer
然后你会看到生成了2个文件:
(1)在plugins/
2.执行001_create_polls.rb文件,使你创建的数据库内容生效:
bundle exec rake redmine:plugins:migrate
3.使用以下命令给model添加内容
bundle exec ruby bin/rails console
[rails 3] rails consol