Migration from SVN to GIT repository - ruby

I found this nice article to migrate from SVN to GIT repo:
http://www.troyhunt.com/2014/08/migrating-from-subversion-to-git-with.html
This method using Ruby's svn2git tool to migrate but I am not able to install svn2git due to below error:
ERROR: Could not find a valid gem 'svn2git' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - no such name (https://rubygems.org/specs.4.8.gz)
Found below link to resolve above issue:
https://gist.github.com/luislavena/f064211759ee0f806c88#manual-solution-to-ssl-issue
But the solution is already present in current Ruby installation. What else can be the problem?
Ruby version- 2.3.0
Plaform: Windows 8
PS:I cannot use SubGit tool.

It was a proxy server issue! I was accessing internet via proxy.
Used the below command to solve the issue:
set http_proxy=username:password#hostname:port
Thanks all.

Make sure you have installed git-svn tool installed, besides git-core.
sudo apt-get install git-svn
After, make sure you have successfully installed svn2git gem.
gem install svn2git
From your error message, I assume you haven't done this successfully.

Related

Unable to install bundler/gems after upgrading jruby and rubymine version (SSLError)

So recently I was encountering some SSL cert issues so in order to help fix that, I've upgraded our jruby 1.7.4 to jruby 9.1.15 and our RubyMine to 2018.2.1 (team using Ruby Cucumber).
However, now we're facing an issue installing /updating gems and bundler after the upgrade.
We're trying to install from the command prompt:
$ set HTTP_PROXY=https://username:password#proxyurl.net:port
$ gem install bundler
And receiving the error:
ERROR: While executing gem ... (OpenSSL::SSL::SSLError)
Received fatal alert: protocol_version
Before setting the proxy the error was:
WARNING: Unable to pull data from 'https://rubygems.org/':
SocketError: Failed to open TCP connection to rubygems.org:443
(initialize: name or service not known)
(https://rubygems.org/specs.4.8.gz)
1 gem installed
I've even tried going to a Starbucks to avoid the proxy altogether but am still getting a similar error.
Just to add in trying to install bundler in RubyMine itself doesn't work.
So somehow I fixed it.. I'm not able to reproduce the fix but that might be related to some foundation problems the fix caused.
Basic steps I used (any of these might help):
Removed versions from gemfile
Trying to install bundler from outside proxy
Install bundler through command prompt and install gems through RubyMine
Change gemfile source to 'http' instead of 'https'
Will update more if I find how to reproduce fix

Gemfile issues and Ruby install issues

I am working on a Windows 7 64-bit machine. I had Ruby version 2.1.5 installed on my machine and everything was working great. I went and installed a gem that would set up a project for you with most of the basics already completed, but it required Ruby 2.2.2. I went and researched how to upgrade my Ruby version and the best solution I found was to install the Pik gem for windows and install 2.2.2 separately, and switch between the two versions.
I followed a tutorial on YouTube for how to set up Pik. I normally use Git Bash but the tutorial required me to use the cmd.exe prompt to set up Pik, and then it included a way to use Pik with Git Bash at the end of the tutorial. I also had to add a file to my PATH in the system settings.
I was able to set up Pik and everything worked great with Pik on both the cmd.exe and Git Bash consoles. However, from there if I went to run any other commands such as bundle install, I would get an error:
Could not locate gemfile.
I have also experienced the same error, but it would say something along the lines of an issue with the .bundle/directory. I tried switching to a project that I had already created in the past and tried running the command again. It still had the same error. (I did this to see if the gemfile in the project would fix anything.) If I try running gem install rails, I have had it work once or twice - but I still have the 'no gemfile' issue after the fact.
The times the command doesn't work I often get:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
certificate verify failed
(https://api.rubygems.org/latest_specs.4.8.gz).
I tried running the pik gem and pik gemsync commands to see if that would fix my issues but it did not.
I tried uninstalling Pik by doing the pik implode command and deleting the files it created. The issue still persisted. I tried uninstalling the 2.2.2 version of Ruby using the uninstall executable in the file, and deleting any left over file(s). The issue still persisted. I tried to uninstall and reinstall Ruby completely from my machine, the 2.1.5 version that is doing the same method as the 2.2.2 version. Yet the issue still persists no matter what I do. I have tried many times uninstalling and reinstalling both Ruby versions, from the executable and from the control panel. I would like to find a way to completely uninstall and reinstall all of Ruby if possible, preferably reinstall Ruby 2.2.2. Or if anyone else has any other ideas for how to fix this issue?
from there if I went to run any other commands such as bundle install I would get an error Could not locate Gemfile.
As you've guessed, you need a file named gemfile in the same location you are running bundle install from
If I try running gem install rails I have had it work once or twice but I still have the no gemfile issue after the fact.
Running gem install <package> doesn't create a gemfile for you. You need to do this yourself. It's essentially a file where you manually specify which packages you would like your project to use. See here on how to create.
The times the command doesn't work I often get: "ERROR: Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from https://rubygems.org/ - SSL_connect retur ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed ( https://api.rubygems.org/latest_specs.4.8.gz)."
This sometimes happens on Windows machine. You can do a quick search on how to fix the gem command with SSL, or in your Gemfile you can temporarily specify http://rubygems.org/ instead of https://rubygems.org/

Can't clone repository with Rugged

Using openSUSE and Ubuntu with installed dependencies I can't clone the remote repository with Rugged::Repository.clone_at method and getting the error message:
Rugged::NetworkError: This transport isn't implemented. Sorry
The code:
credentials = Rugged::Credentials::SshKey.new(:privatekey=>'path/to/privatekey', :publickey=>'path/to/publickey', :passphrase=>'passphrase')
Rugged::Repository.clone_at 'ssh://github.com/vmoravec/repo', 'dir/to/destination', :credentials => credentials
My Gemfile for a rails project contais reference to the github repo like this:
gem 'rugged', git: 'git://github.com/libgit2/rugged.git', branch: 'development', submodules: true
The gem has been installed with command bundle install --path bundle/
The cloning does not work even with using bundle exec rails console
Installed system packages:
libssh2, libssh2-devel
openssl, libopenssl-devel, libopenssl
There is already similar question asked here on SO, but the solution does not work (although it's for MacOS I think): Getting Rugged::NetworkError on #connect
Removing the bundle/ directory and reinstalling the gems with bundle install --path bundle/ resolved the issue on both systems. It seems that the build system was not able for some reasons to detect the /usr/lib64/libssh2.so.1 dependency required for ssh transport. Carlos, thanks for the hint to use ldd rugged.so to check that.

"Quick Install Gem" not working on RubyMine

I've just done a fresh install of RubyMine 4.5 in order to get a quickstart on Rails dev.
Whenever I try and install any Gem using the Tools > Quick Install Gem... command, I get the following error (below is specific to the flickraw gem)
Failed to Install Gems
Following gems were not installed:
flickraw(0.9.6): While executing gem ...
(Errno::EACCESS)
Permission denied - /Users/Andy/.rvm/gems/ruby-1.9.3-p194/cache/flickraw-0.9.6.gem
I guess I get that it's a permissions error...but why is it happening, shouldn't this just work? And how do I fix it?
I'm running this on the latest version of OSX Mountain Lion.
I've had similar problems before, it turned out to be caused by sudo being the owner of some gems installed in that rvm ruby installation I was using. I guess I installed something with sudo by accident, I dunno-- but go check in /Users/Andy/.rvm/gems/ruby-1.9.3-p194/cache and /Users/Andy/.rvm/gems/ruby-1.9.3-p194/gems and see if sudo owns cache/flickraw-0.9.6.gem or any folders in gems and if needed change the owner and group back to you ... I actually had so many messed up I opted to just remove and rebuild that ruby.

ruby gem install issue - ERROR: Could not find a valid gem 'vim-ruby' (>= 0) in any repository

I typed following command in prompt:
# gem install vim-ruby --remote
then got a error message:
ERROR: Could not find a valid gem 'vim-ruby' (>= 0) in any repository
My environment is windows xp and ruby's version is 1.9.3
how to solve it?
vim-ruby is not a gem. Checking the gem repository using gem list vim -r returns several gems, but not that one.
From the docs:
How you get these files into Vim:
[...]
By downloading one of the tarballs, you can easily install the latest
stable or development version wherever you like on your machine. No
README, no vim-ruby-install.rb, just Vim files. You would typically
install these into either $VIM/vimfiles, for system-wide use, or $HOME/.vim
($HOME/vimfiles on Windows) for personal use.
Remember that when you install Vim in the first place, all of these files
are present. The purpose of downloading and installing them from
github is to get the latest version of them.
vim-ruby is not a gem but the page: https://github.com/vim-ruby/vim-ruby has a link https://github.com/vim-ruby/vim-ruby/wiki in which the link "VimRubySupport" has a section "Installing the latest version" which shows the vim-ruby as a gem. I too had the same problem as the original post. I downloaded the archive file from http://rubyforge.org/projects/vim-ruby/ which has a .rb file (bin/vim-ruby-install.rb after untarring the archive in my case) which installs the required vim files.
This method should solve your issue:
$ gem install --http-proxy http://201.187.107.19:8080 vim-ruby
Note, the IP address and the port number refers to a proxy. You should search for a proxy list and use one of the proxies there.
This is sample site with proxies: http://www.cybersyndrome.net/pla5.html

Resources