How to properly bundle install on a Ruby on Rails web-app? - ruby-on-rails

I am trying to run bundle install while in the base dir of a git cloned Ruby on Rails repo on an Ubuntu subsystem (on Windows 10). But I keep getting this error:
Fetching gem metadata from https://rubygems.org/..........
Fetching git#bitbucket.org:wishartlab/wishart
Forbidden
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
Retrying `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` at /home/sukanta/phastest/phaster-web due to error (2/4):
Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web'
Retrying `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` at /home/sukanta/phastest/phaster-web due to error (3/4):
Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web' Retrying `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` at /home/sukanta/phastest/phaster-web due to error (4/4):
Bundler::Source::Git::GitCommandError Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web'
Git error: command `git clone --bare --no-hardlinks --quiet -- git#bitbucket.org:wishartlab/wishart /home/sukanta/.rbenv/versions/2.6.6/lib/ruby/gems/2.6.0/cache/bundler/git/wishart-32827d90c8420e2e6b6bd9330b841cfef2863a8c` in directory /home/sukanta/phastest/phaster-web has failed.
If this error persists you could try removing the cache directory '/home/sukanta/phastest/phaster-web'
I have added my ssh key to Bitbucket and have the rights to the repo so that should not be a problem.

Related

Elastic Beanstalk AWS Rails Bundle Install Failure

I'm trying to deploy my rails app using AWS and Elastic Beanstalk. My deployment worked but the health is at a 'red' status - error 11 (bundle install failed).
I tried:
$ gem update bundler
$ bundle package --all
Still the same error.
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# ruby "2.4.1"
+ '[' -d /var/app/ondeck/vendor/cache ']'
+ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: the running version of Bundler (1.16.0) is older than the version that created the lockfile (1.16.1). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/.........
Fetching https://github.com/mshibuya/remotipart.git
sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Retrying `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `git clone 'https://github.com/mshibuya/remotipart.git' "/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779" --bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.sh: git: command not found
Git error: command `git clone 'https://github.com/mshibuya/remotipart.git'
"/opt/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/cache/bundler/git/remotipart-f9606ede17c5ca255592b042ebded6ea195ac779"
--bare --no-hardlinks --quiet` in directory /var/app/ondeck has failed.
You need to install git.
You can create a file .ebextensions/git.config in your rails app:
packages:
yum:
git: []
Then try to deploy again
By default, the Load Balancer target group uses "/" for the health check. Make sure your rails app responses to that endpoint with 200 status or you can update the health check path to a relevant one.

Cannot allocate memory for activeadmin in ubuntu 14.04 with DigitalOcean

I am facing below error while doing bundle install using Ubuntu 14.04 with DigitalOcean
Fetching source index from https://rubygems.org/
Fetching git://github.com/activeadmin/activeadmin.git
Retrying git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet due to error (2/3): Errno::ENOMEM Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet
Retrying git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet due to error (3/3): Errno::ENOMEM Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet
Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/sachin/.rvm/gems/ruby-2.1.1#global/gems/bundler-1.7.12/lib/bundler/source/git/git_proxy.rb:114:in ``': Cannot allocate memory - git clone 'git://github.com/activeadmin/activeadmin.git' "/home/sachin/.rvm/gems/ruby-2.1.1/cache/bundler/git/activeadmin-c24fcef949b2f1bbdf6b5a17650dcd86d73f2528" --bare --no-hardlinks --quiet (Errno::ENOMEM)
Would anybody know of a solution?
I have found solution that I do need some more memory for bundle install. That's why I have created swap in harddisk with 512MB memory and it is working fine for me.
You can create swap from here.

Error when installing bower package

I get an error when I try to install a bower packeg.
My error :
MacBook-Pro-de-Anthony:Front-End anthonycluse$ bower install flexslider
bower cached git://github.com/woothemes/FlexSlider.git#ce5441b214
bower validate ce5441b214 against git://github.com/woothemes/FlexSlider.git#*
bower ECMDERR Failed to execute "git ls-remote --tags --heads git://github.com/woothemes/FlexSlider.git", exit code of #128
Additional error details:
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Connection refused
The error may be due to proxy/certificate connectivity issues, try following command for the error exit code of #128
git config --global url."https://".insteadOf git://

Capistrano: SSHKit::Command::Failed: bundle exit status: 1

I'm using capistrano 3.2.1 with Rails 4.1 application. I'm trying to install gem from my github repo. But it's not work. I have no idea what's going on. When I run ssh -T git#github.com on my server it's success. But when I run cap production deploy I get following errors.
[aff68e9c] Finished in 9.435 seconds with exit status 0 (successful).
INFO [45eeecaf] Running /usr/local/rvm/bin/rvm 2.0.0-p451#rails-4.1 do bundle install --binstubs /opt/www/moto/shared/bin --path /opt/www/moto/shared/bundle --without development test --deployment --quiet on 107.170.74.157
DEBUG [45eeecaf] Command: cd /opt/www/moto/releases/20140429073253 && /usr/local/rvm/bin/rvm 2.0.0-p451#rails-4.1 do bundle install --binstubs /opt/www/moto/shared/bin --path /opt/www/moto/shared/bundle --without development test --deployment --quiet
DEBUG [45eeecaf] Warning, new version of rvm available '1.25.24', you are using older version '1.25.22'.
DEBUG [45eeecaf] You can disable this warning with: echo rvm_autoupdate_flag=0 >> ~/.rvmrc
DEBUG [45eeecaf] You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
DEBUG [45eeecaf] You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
DEBUG [45eeecaf] Host key verification failed.
DEBUG [45eeecaf] You can enable auto-update with: echo rvm_autoupdate_flag=2 >> ~/.rvmrc
DEBUG [45eeecaf] fatal: Could not read from remote repository.
DEBUG [45eeecaf]
DEBUG [45eeecaf] Please make sure you have the correct access rights
DEBUG [45eeecaf] and the repository exists.
DEBUG [45eeecaf] Retrying git clone 'git#github.com:sdfsd/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.ssdfsdf/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet` in directory /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] fatal: Could not read from remote repository.
DEBUG [45eeecaf]
DEBUG [45eeecaf] Please make sure you have the correct access rights
DEBUG [45eeecaf] and the repository exists.
DEBUG [45eeecaf] Retrying git clone 'git#github.sfafsd/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.sdfsafa/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet` in directory /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] Host key verification failed.
DEBUG [45eeecaf] Retrying git clone 'git#github.sfsafas/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet due to error (2/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.sdfsafs/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet` in directory /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] fatal: Could not read from remote repository.
DEBUG [45eeecaf]
DEBUG [45eeecaf] Please make sure you have the correct access rights
DEBUG [45eeecaf] and the repository exists.
DEBUG [45eeecaf] Retrying git clone 'git#github.sdfsa/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.sfsadfs/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet` in directory /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] fatal: Could not read from remote repository.
DEBUG [45eeecaf]
DEBUG [45eeecaf] Please make sure you have the correct access rights
DEBUG [45eeecaf] and the repository exists.
DEBUG [45eeecaf] Retrying git clone 'git#github.sdfsfsa/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.sfdsaf/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet` in directory /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] Host key verification failed.
DEBUG [45eeecaf] Retrying git clone 'git#github.dsffsd/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet due to error (3/3): Bundler::Source::Git::GitCommandError Git error: command `git clone 'git#github.sdfsfs/mongoid_auto_increment.git' "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d" --bare --no-hardlinks --quiet` in directory /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] fatal: Could not read from remote repository.
DEBUG [45eeecaf]
DEBUG [45eeecaf] Please make sure you have the correct access rights
DEBUG [45eeecaf] and the repository exists.
DEBUG [45eeecaf] Git error: command `git clone
DEBUG [45eeecaf] 'git#github.sdfdsfs/mongoid_auto_increment.git'
DEBUG [45eeecaf] "/opt/www/moto/shared/bundle/ruby/2.0.0/cache/bundler/git/mongoid_auto_increment-be1b78474ac71203d9549e08e5b3158473ff391d"
DEBUG [45eeecaf] --bare --no-hardlinks --quiet` in directory
DEBUG [45eeecaf] /opt/www/moto/releases/20140429073253 has failed.
DEBUG [45eeecaf] fatal: Could not read from remote repository.
DEBUG [45eeecaf]
DEBUG [45eeecaf] Please make sure you have the correct access rights
DEBUG [45eeecaf] and the repository exists.
cap aborted!
SSHKit::Command::Failed: bundle exit status: 11
bundle stdout: Nothing written
bundle stderr: Host key verification failed.
fatal: Could not read from remote repository.
Any idea? if u need more info let me know.
Change
git#github.com:zolzaya/mongoid_auto_increment.git
to
git://github.com/zolzaya/mongoid_auto_increment.git
This should work.

Ruby bundle install error

I'm trying to install forem on my server, and i'm getting this error when I run bundle install:
Fetching git://github.com/radar/forem.git
fatal: unable to connect to github.com:
github.com[0: 207.97.227.239]: errno=Connection refused
Git error: command `git clone 'git://github.com/radar/forem.git' "/home/box1/.bundler/cache/git/forem-8662403862ddafa624baa2b55484281b10db048e" --bare --no-hardlinks` in directory /home/box1/rails_apps/forem has failed.
Try cloning using HTTP and not SSH:
git clone https://github.com/radar/forem.git
See answer and comments to similar question.

Resources