Skip to content
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

how to trouble shoot svb2git #321

Open
cjohnshu opened this issue Mar 27, 2023 · 4 comments
Open

how to trouble shoot svb2git #321

cjohnshu opened this issue Mar 27, 2023 · 4 comments

Comments

@cjohnshu
Copy link

I use ruby svn2git.
I have the following error

F:\PRJ\dba>svn2git svn://localhost/ --prefix=svn/ --trunk / --nobranches --notags --authors dba_authors.txt
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb:58:in parse': undefined method exists?' for File:Class (NoMethodError)

  if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
         ^^^^^^^^

Did you mean? exist?
from D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb:14:in initialize' from D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/svn2git-2.4.0/bin/svn2git:26:in new'
from D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/svn2git-2.4.0/bin/svn2git:26:in <top (required)>' from D:/Ruby32-x64/bin/svn2git:32:in load'
from D:/Ruby32-x64/bin/svn2git:32:in `

'

@cjohnshu
Copy link
Author

This version of svn2git should ignore method `exists?' but the migration.rb in this build still reference to it.
Line 58 of migration.rb
#if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))

options[:authors] = DEFAULT_AUTHORS_FILE

#end

@MattIhnen
Copy link

Same issue here, installed via gem. Looks like ruby removed the plural method exists in version 3.2.0, should use the singular File.exist? instead.

@josh6025
Copy link

Same issue here, installed via gem. Looks like ruby removed the plural method exists in version 3.2.0, should use the singular File.exist? instead.

Thanks for that, I ended up downloading Ruby 3.1.4-1 and was able to continue without any issues.

@Rikj000
Copy link

Rikj000 commented Nov 20, 2024

Work Around for v2.4.0

Open migration.db as admin in your favorite text editor, preferably with line numbering,
I'm on Manjaro Linux, so for me the path was different,
your error should tell you which file though.

For me on Linux it was under:
/usr/lib/ruby/gems/3.2.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb
For @cjohnshu on Windows I can see it's under:
D:/Ruby32-x64/lib/ruby/gems/3.2.0/gems/svn2git-2.4.0/lib/svn2git/migration.rb

Then alter line 58 as following:

- if File.exists?(File.expand_path(DEFAULT_AUTHORS_FILE))
+ if File.exist?(File.expand_path(DEFAULT_AUTHORS_FILE))

Save and exit, svn2git should work as expected now, no Ruby downgrade required! 🎉

Permanent solution

See MR by @sudipm-mukherjee: #333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants