Redmine 1.4存储库创建问题

时间:2012-04-19 08:00:48

标签: ruby-on-rails ruby redmine

当我尝试在Redmine 1.4中为项目创建Mercurial存储库时,我收到以下错误:它曾经与Redmine 1.3完美配合

Rendering /var/redmine/public/500.html (500 Internal Server Error)


Processing RepositoriesController#create (for 117.201.161.229 at 2012-04-19 00:58:17) [POST]
  Parameters: {"controller"=>"repositories", "commit"=>"Create", "repository_scm"=>"Git", "authenticity_token"=>"D9c30kq2pf/mhM3iGcCvRNykEFamKuFddJXEs+xmSEo=", "action"=>"create", "repository"=>{"url"=>"/home/nettantra_base/domains/hg.nettantra.com/repos/nt-test", "checkout_display_command"=>"0", "path_encoding"=>"", "identifier"=>"", "checkout_description"=>"The data contained in this repository can be downloaded to your computer using one of several clients.\r\nPlease see the documentation of your version control software client for more information.\r\n\r\nPlease select the desired protocol below to get the URL.\r\n", "checkout_overwrite"=>"0", "is_default"=>"1", "checkout_protocols"=>{"-1"=>{"protocol"=>"empty"}, "0"=>{"fixed_url"=>"", "access"=>"permission", "command"=>"git clone", "protocol"=>"Git", "is_default"=>"1"}}, "extra_report_last_commit"=>"0"}, "project_id"=>"test-project"}

NoMethodError (undefined method `project=' for nil:NilClass):
  app/controllers/repositories_controller.rb:49:in `create'
  passenger (3.0.11) lib/phusion_passenger/rack/request_handler.rb:96:in `process_request'
  passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:513:in `accept_and_process_next_request'
  passenger (3.0.11) lib/phusion_passenger/abstract_request_handler.rb:274:in `main_loop'
  passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:321:in `start_request_handler'
  passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `send'
  passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:275:in `handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/utils.rb:479:in `safe_fork'
  passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:270:in `handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:180:in `start'
  passenger (3.0.11) lib/phusion_passenger/classic_rails/application_spawner.rb:149:in `start'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:219:in `spawn_rails_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:132:in `lookup_or_add'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:214:in `spawn_rails_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:82:in `synchronize'
  passenger (3.0.11) lib/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:213:in `spawn_rails_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:132:in `spawn_application'
  passenger (3.0.11) lib/phusion_passenger/spawn_manager.rb:275:in `handle_spawn_application'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `__send__'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:357:in `server_main_loop'
  passenger (3.0.11) lib/phusion_passenger/abstract_server.rb:206:in `start_synchronously'
  passenger (3.0.11) helper-scripts/passenger-spawn-server:99

Rendering /var/redmine/public/500.html (500 Internal Server Error)

1 个答案:

答案 0 :(得分:3)

好像你和Redmine 1.4一起运行redmine_checkout插件,redmine_checkout的最新发布版本(0.5)还没有为Redmine 1.4做好准备。

然而,在Github上有补丁,特别是来自用户tonybarbieri的补丁。我合并了它们并添加了另一个用Ruby 1.9.3运行它的修复程序,你也可以在Github找到结果。

因此,解决方案是将您的redmine_checkout插件版本更新为Git master上的最新版本(例如,通过克隆我的Github存储库):

cd vendor/plugins
rm -R redmine_checkout
git clone git://github.com/rkallensee/redmine_checkout.git redmine_checkout

不要忘记从Redmine安装目录运行插件迁移:

rake db:migrate_plugins RAILS_ENV=production

可能你必须运行

bundle install --without development test
再次从Redmine安装目录

(至少我不得不 - 否则rake db:migrate_plugins RAILS_ENV=production命令失败 - 即使bundle install没有安装任何新宝石)。

重新启动Redmine安装,你应该没问题!