redmine插件安裝及卸載
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