New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git.open causes ArgumentError (When assigning attributes, you must pass a hash as an argument, String passed.) #707
Comments
Can you please provide the complete error? I am not sure where the error is coming from. Do you have a model in your rails project (or some other class) named I am having trouble duplicating your environment. If you could provide a dockerfile that builds an image that can be used to demonstrate the error, that would be ideal. Or if your project is OpenSource, point me to the Github repository. |
Thanks @jcouball for your reply.
Yes, I do have a namespace
lib/clients.rb:
app/jobs/git/repository_traversing_job.rb:
Both the
|
Just to be sure, what does the following output? puts Clients.git.class
puts Clients.git.method(:open).source_location |
|
If you rename your |
Yes, if I delete the Git module in my repo, the clone/open functions seem to be working. Is there a way I can keep the Git module in my repo and still use this gem? |
Unfortunately, something that you or Rails is doing conflicts with the Git gem. Remember, when you open Generally, you should create a module structure that does not open other modules and make changes to them. I would recommend a structure under I don't think this is a problem with the git gem so I am closing this issue. |
Subject of the issue
Running Git.open in a rails environment throws ArgumentError (When assigning attributes, you must pass a hash as an argument, String passed.)
Your environment
Steps to reproduce
/home/app/git/hello-world
rails c
require 'git'
Git.open('/home/app/git/hello-world')
ArgumentError (When assigning attributes, you must pass a hash as an argument, String passed.)
Expected/Actual behaviour
When I run the same commands in IRB (i.e., not rails environment), I correctly receive the Git::Base instance. I should receive this same object in the rails environment, but I get the error instead.
The text was updated successfully, but these errors were encountered: