redmine插件安裝及卸載

本文档介绍了如何在Redmine中安装和卸载插件,包括进入Redmine目录运行bundle命令进行安装和卸载,并通过systemctl重启apache2服务。在安装过程中遇到`PG::ConnectionBad`错误,提示数据库连接失败。解决方案是启动postgresql服务。
摘要由CSDN通过智能技术生成

redmine plugin安裝

cd <redmine_dir>
bundle install
RAILS_ENV=production bundle exec rake db:migrate
RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=<plugin_name>
systemctl restart apache2

redmine plugin解除安裝

Revert all db operations:

cd <redmine_dir>
RAILS_ENV=production bundle exec rake redmine:plugins:migrate NAME=<plugin_name> VERSION=0

Delete the folder of your plugin and then restart:

systemctl restart apache2

Troubleshooting

PG::ConnectionBad: connection to server at “localhost” (127.0.0.1), port 5432 failed: Connection refused

下`RAILS_ENV=production bundle exec rake db:migrate``時碰到如下錯誤:

root@xxx:/home/redmine/redmine# RAILS_ENV=production bundle exec rake db:migrate
rake aborted!
PG::ConnectionBad: connection to server at "localhost" (127.0.0.1), port 5432 failed: Connection refused
        Is the server running on that host and accepting TCP/IP connections?
connection to server at "localhost" (::1), port 5432 failed: Cannot assign requested address
        Is the server running on that host and accepting TCP/IP connections?
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/pg-1.1.4/lib/pg.rb:56:in `initialize'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/pg-1.1.4/lib/pg.rb:56:in `new'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/pg-1.1.4/lib/pg.rb:56:in `connect'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql_adapter.rb:692:in `connect'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql_adapter.rb:223:in `initialize'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `new'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/postgresql_adapter.rb:48:in `postgresql_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:830:in `new_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:874:in `checkout_new_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:853:in `try_to_checkout_new_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:814:in `acquire_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:538:in `checkout'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:382:in `connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:1033:in `retrieve_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_handling.rb:118:in `retrieve_connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/connection_handling.rb:90:in `connection'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.4.5/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/bin/ruby_executable_hooks:22:in `eval'
/home/redmine/redmine/vendor/bundle/ruby/2.6.0/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

在已安裝postgresql的情況下,解決方式為:

service postgresql start
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值