git repository browsing impossible with passenger/modrails
Added by Raphaël Bauduin about 16 years ago
Hi,
I have installed redmine to hangle a git project. I have alredy deployed several redmines in this config, but ran the app with mongrel or even webrick.
Now I try to run it with passenger/mod_rails and encounter a problem: the url /repositories/show/myproject lists the last commits, but doesn't show the repository browser.
Running the same installation with webrick, under the user redmine used by passenger to run the app, I get the repository browser displayed.
Looking at the template, there's this code:
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<h3><%= l(:label_browse) %></h3>
<%= render :partial => 'dir_list' %>
<% end %>
And with passenger @entries is nil. It is set like this in the controller: @entries = @repository.entries('', @rev)
Does any one have a hint on how to correct this problem?
Thanks
Raph
Replies (5)
RE: git repository browsing impossible with passenger/modrails
-
Added by Jim Mulholland about 16 years ago
I'm not sure what this exact problem is, but I can verify that repository browsing does work with Passenger. I am running a Redmine instance through Passenger now and and browse a few git repos.
RE: git repository browsing impossible with passenger/modrails
-
Added by Raphaël Bauduin about 16 years ago
Hey Jim,
Thanks for the info already! It means I have to search further :-)
What are the user rights and apache config in your setup?
I run redmine under the redmine user, the git repo is a shared repository owned by user git:git at /var/lib/git/myrepo , and redmine is in the group git.
HEre's my apache config:
DocumentRoot /usr/local/railsapps/redmine/public
RailsEnv development
User redmine can clone the git repo. And the application run with webrick shows the repository browser.
Any hint welcome!
Raph
RE: git repository browsing impossible with passenger/modrails
-
Added by Raphaël Bauduin about 16 years ago
FYI, this was due to Redmine not finding the git executable when run with passenger.
I solved it by editing lib/redmine/scm/adapters/git_adapter.rb and changing the value of GIT_BIN to /usr/local/git/bin/git
Raph
RE: git repository browsing impossible with passenger/modrails
-
Added by Calvin Cheng about 16 years ago
Does this have to do with the fact that your should be pointing to /var/lib/git/myrepo/.git instead of /var/lib/git/myrepo as indicated by you above?
If this is the case, then there shouldn't be a need for you to modify git_adapter.rb file.
Regards,
Calvin
RE: git repository browsing impossible with passenger/modrails
-
Added by Kirk Stork almost 14 years ago
Raphaël Bauduin wrote:
FYI, this was due to Redmine not finding the git executable when run with passenger.
I solved it by editing lib/redmine/scm/adapters/git_adapter.rb and changing the value of GIT_BIN to /usr/local/git/bin/gitRaph
Aha. This worked for me also. Thanks Raph.
My environment is OS X Server, but I use many packages from the macports project (including ruby, rails, git, etc.) Since OS X comes with some of these tools, being careful about environment and paths becomes crucial if you don't want to use the built-in apps and services. I had a similar problem with subversion and various ssl libraries.
This makes me wonder. Is there a place in the Redmine config system to specify environment variables to control this sort of thing? It would be nice to have a place outside the source tree to say "this is where my git lives, this is where my svn lives" etc.
PS @ Calvin -- my repo's work fine now without being suffixed by .git. The key thing appears to be that they be created --bare.