Error while fetching git file using Bundler - ruby

Gemfile:
source "http://rubygems.org"
gem "nokogiri", :git => "git://github.com/tenderlove/nokogiri.git"
When I run bundle, the following error occurs:
Fetching git://github.com/tenderlove/nokogiri.git
Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
C:/Ruby193/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/source.rb:592:in ``': No such file or directory - git clone "git://github.com/tenderlove/nokogiri.git" "C:/Ruby193/lib/ruby/gems/1.9.1/cache/bundler/git/nokogiri-d4bf05cb9e65f144f074351e5ebe3a0e44c00952" --bare --no-hardlinks (Errno::ENOENT)
How can I solve it?
It's reproducible not only with this gem but also with other gems: cucumber, capybara
I use Windows.

It was because I didn't have Git installed.
I installed Git and added it into PATH system variable. bundle became to work after that

For any other newbies out there, I installed Git on Windows 7 with msysgit.
Then in the msysgit command window (MINGW32) I moved to my rails project directory and ran bundle install and it worked fine.
Thanks for helping me with this Andrey.

Related

Where does Bundler install gems pulled from Github?

I want to put a debugger in a file for testing, but can't find where Bundler installs gems pulled from Github on my local machine.
I've looked at this thread http://bundler.io/v1.5/git.html which shows how to setup a local file repo to pull from, but I would rather avoid this as my situation is a one off debugging scenario.
I use rbenv for my ruby and gem management. When I pull in a gem from a git repo, it places the files for the gem here:
/usr/local/var/rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/gem-name-SHA/
On my machine bundler installed the gem in:
~/.rvm/gems/ruby-2.3.3/bundler/gems/gem-from-github
gem which [GEM] doesn't work on its own, but bundle exec gem which [GEM] does.

MIDDLEMAN: "$ middleman init my_new_project" not working (screenshot attached)

I just installed Ruby and Middleman for the first time and I cannot get past the very first "$ middleman init my_new_project" step. I have tried Googling for solution to my problem but unfortunately I couldn't find anything that looks like the error I'm encountering.
I hope someone can help me out.
OS: Windows 10 |
Ruby: 2.2.3 (x64) (tried Ruby 2.1.7 first) |
Middleman: 4.0.0
This is the error message I'm getting when I try to create a new project in a folder I created to try out Middleman:
run git clone --depth 1 git://github.com/middleman/middleman-templates-default.git C:/Users/Lenovo/AppData/Local/Temp/d20160120-1612-c2sqbk from "."
exist new_project_test
run bundle install from ".new_project_test"
Could not locate Gemfile or .bundle/ directory
This just creates an empty "new_project_test" folder.
Screenshot of the command prompt: middleman init not working (alt. image link)
What happens if you just run 'middleman init'?
You can also try to create the Gemfile manually, if it's not getting created on the first step, then run init again. The default one would look like this:
# If you do not have OpenSSL installed, update
# the following line to use "http://" instead
source 'https://rubygems.org'
gem "middleman", "~>3.4.1"
# Live-reloading plugin
gem "middleman-livereload", "~> 3.3.0"
# For faster file watcher updates on Windows:
gem "wdm", "~> 0.1.0", :platforms => [:mswin, :mingw]
# Windows does not come with time zone data
gem "tzinfo-data", platforms: [:mswin, :mingw, :jruby]

Gem from custom git repository is not available

I tried to modify an existing gem and forked the git repository.
I added some commits and pointed bundler to my GitHub repository.
bundler update does recognise the change and downloads my version of the gem.
Anyway when I try to launch the application which depends on that gem (testkitchen) my changes aren't available. And when I delete the official version of the gem my version is not found/used and the app fails.
The weird thing is that all the official gems are installed to /var/lib/gems and my version goes to ~/.bundler
gem environment also shows up the correct directories
- GEM PATHS:
- /var/lib/gems/2.2.0
- /home/ansible/.bundler/ruby/2.2.0
I'm not using rvm or similar. Am I doing something wrong?
As #matt pointed out I forgot to add bundle exec to my commands.

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.

Installing rake

we tried to install rake on our pc but there were following errors.. We even tried updating gems but in vain. We need to run some tasks on rake and dont know how to go abt it.
C:\Documents and Settings\nemanich\My Documents\gems>gem install rake-compi 0
.7.0.gem
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: Error installing rake-compiler-0.7.0.gem:
rake-compiler requires RubyGems version >= 1.3.5
C:\Documents and Settings\nemanich\My Documents\gems>gem install update_rubygems
.gem
ERROR: http://gems.rubyforge.org/ does not appear to be a repository
ERROR: could not find gem update_rubygems.gem locally or in a repository
Are you behind a proxy server? If so, set your HTTP_PROXY environment variable appropriately. This is the sort of error you get when the repository can't be contacted. For example:
set HTTP_PROXY=http://proxy.mycompany.com:8888
will set it temporarily.
I don't think that's the command to update RubyGems. Have you tried gem update --system? You might be able to install Rake after that.

Resources