Creating a new project raise 500 error due to repository folder not creared before to call Grit
Created by: zedtux
I'm installing Gitlab on my Ubuntu VPS.
I'm using Ruby 1.9.2-p286 with the master branch of Gitlab.
- I completely installed it
- logged in as [email protected]
- immediately created my account as Administrator
- login with my account
- Delete [email protected] account
- Create my new project
- Got a 500 error.
Error from log file:
Processing by Admin::ProjectsController#show as HTML
Parameters: {"id"=>"dotfiles"}
Rendered admin/shared/_projects_head.html.haml (1.2ms)
Rendered admin/projects/show.html.haml within layouts/admin (2.6ms)
Completed 500 Internal Server Error in 7ms
ActionView::Template::Error (/home/git/repositories/dotfiles.git):
5: %i.icon-edit
6: Edit
7:
8: - if !@admin_project.has_post_receive_file? && @admin_project.commit
9: %br
10: .alert.alert-error
11: %span
app/roles/repository.rb:78:in `new'
app/roles/repository.rb:78:in `repo'
app/roles/repository.rb:16:in `commit'
app/views/admin/projects/show.html.haml:8:in `_app_views_admin_projects_show_html_haml___4358526362629108065_193540400'
Code at line app/roles/repository.rb:78:
def repo
@repo ||= Grit::Repo.new(path_to_repo)
end
Opening the Rails console in production environment and executing the following:
irb(main):001:0> Grit::Repo.new("/home/git/repositories/dotfiles.git")
Grit::NoSuchPathError: /home/git/repositories/dotfiles.git
from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/bundler/gems/grit-7f35cb98ff17/lib/grit/repo.rb:53:in `initialize'
from (irb):2:in `new'
from (irb):2
from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
irb(main):002:0> FileUtils.mkdir("/home/git/repositories/dotfiles.git")
=> ["/home/git/repositories/dotfiles.git"]
irb(main):003:0> Grit::Repo.new("/home/git/repositories/dotfiles.git")
=> #<Grit::Repo "/home/git/repositories/dotfiles.git">
irb(main):004:0>