I'm using Bundler version 1.3.5 and Ruby 2.0.0-rc2.
When I use the command bundle install --deployment on my production server all my gems are copied to vendor/bundle, except for the one that has a :git source in the Gemfile.
I don't get any errors and the gem is listed and even downloaded when running the command, but it's not in the vendor/bundle folder.
All resources I've found on this are related to out-dated versions of Bundler which did not have this feature. Why is this happening on 1.3.5, though?
Your "git" gem is stored and loaded from the cache directory. I think it's an implementation detail.
I've found the following note in the documentation:
While installing gems, Bundler will check vendor/cache and then your
system's gems. If a gem isn't cached or installed, Bundler will try to
install it from the sources you have declared in your Gemfile.
So the gem will be downloaded from git into vendor/cache, then bundler is going to install it, but it's already in the vendor/cache. So that is probably the reason, why you can't find it in the vendor/bundle directory.
Related
In my Rails app, I have installed the gem sdoc from Github by specifying gem 'sdoc', github: 'voloko/sdoc' in my Gemfile. All was well until I recently updated Bundler to v1.6.0.rc.
Now I get the following error message when Bundler tries to load the gem:
There was a LoadError while loading sdoc.gemspec:
cannot infer basepath from
/Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/sdoc-1a0e80c2d629/sdoc.gemspec:2:in `require_relative'
Does it try to require a relative path? That's been removed in Ruby 1.9.
I've already fixed the issue and submitted a pull request, but I cannot get rid of the "broken" gem!
This is what I tried:
removing the gem from the Gemfile or setting it to a different version
removing Gemfile.lock
deleting the gem folder /Users/manuel/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/bundler/gems/sdoc-1a0e80c2d629
gem uninstall sdoc (It doesn't even appear in gem list)
Nothing helped, every time I do bundle install or bundle update afterwards, I get the same error.
Any hints?
First-off: Clarifying a few things
From the Bundler documentation:
Because Rubygems lacks the ability to handle gems from git, any gems installed from a git repository will not show up in gem list. They will, however, be available after running Bundler.setup
Also, after deleting the gem inside the . . . /bundler/gems/ directory, you also should run rbenv rehash. This should get rid of the gem for you.
Answer:
Go to the root directory of your project (where the Gemfile resides) and run bundle clean. You have to pass either --path or --force switches. This should remove gems installed via git (usually if you have those gems installed and listed by gem list).
If you have issues. Delete the directories manually as you already tried and run rbenv rehash.
If I were you I would downgrade Bundler (ie. uninstall the RC release and install the latest stable).
I add some gem to my gemfile.
Then i type :
$ bundle install
It will install the newly add gems in general , But it install the all gems, and it very slowly.
This is my terminal output:
Fetching gem metadata from http://rubygems.org/.........
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies...
Enter your password to install the bundled RubyGems to your system:
Using rake (10.1.0)
Using i18n (0.6.5)
...
So:
How to make the bundle install fast, and i don't want it always install all gems
If you see Using gemname (version), it means the gem is already installed and Bundler doesn't reinstall it.
You need to bundle install all of your gems as there are dependency requirements between them. Bundler doesn't reinstall the gem's which state Using rake (10.1.0), but just confirms it's version to ensure gem dependency and prevent your application from producing runtime errors.
You can find out more information here:
http://bundler.io/
I had unicorn 4.5.0 and after I did bundle update, I observe different versions of the same gem even though I wanted to use the latest version.
unicorn (4.6.1, 4.5.0)
How do I instruct the bundler to just keep the latest version.
As far as I can see you cannot instruct bundler to keep only the latest version when updating. You can delete all the old versions of all gems in one go:
bundle exec gem cleanup
(Reference)
You can instruct bundler to just use one version by putting that version in the gem file. Sometimes, I have had conflicts with rake, even though I did not explicitly have rake in my Gemfile, so I had to put the rake version that would be usable by all the other gems at the top of my Gemfile.
If your issue is that you used to use unicorn 4.5.0, and now it has installed unicorn 4.6.1 in you local gem source, you can tell gem to uninstall the version you no longer need.
gem uninstall unicorn --version 4.5.0
If you did a bundle --deployment and populated the vendor/bundle directory, and that is where you want to remove the gem from, then I usually just delete the gem directory, however, I think you can run bundle with --path, like the following:
bundle --deployment --path vendor/bundle
gem uninstall unicorn --version 4.5.0
When you run bundler, it remembers the settings. I painfully discovered this regarding the --without switch. The --path setting will tell gem to use the local vendor/bundle directory as your local gem source. Remember to set the path back by running bundle again.
This is my very first question here :)
On a rails 3.2.6 (using rvm and ruby 1.8.7), my Gemfile contains two gems that cause problems when using the bundle install command.
Those gems are specified using:
gem 'libv8', "~> 3.11.8.3"
gem 'therubyracer', '~> 0.11.0beta6'
My problem is the following: when running bundle install command, bundler fetches binaries (precompiled) gems (libv8-3.11.8.3-x86_64-linux.gem and therubyracer-0.11.0beta6-x86_64-linux.gem) and not the plain source ones (libv8-3.11.8.3.gem and therubyracer-0.11.0beta6.gem).
The x86_64 version is incompatible with my server setup: included dynamic library uses an unknown symbol (rb_intern2, out of my old memory, I could be wrong) that makes that the precompiled gems cant be loaded by the application.
So that I must install gem from the source packages.
At the moment, I have to bundle install, then remove the precompiled gems from my ~/.rvm/gems/... and then gem install ~/tmp/libv8-3.11.8.3.gem and gem install ~/tmp/therubyracer-0.11.0beta6.gem, which is not very practical.
Is there any way to force Bundler to fetch the sources release and compile them ?
try:
bundle install --without x86_64-linux
x86_64-linux is a platform and bundler/rubygems uses it.
It should be equivalent of:
gem install libv8 --platform ruby
Details:
http://gembundler.com/man/gemfile.5.html
http://guides.rubygems.org/command-reference/#gem_install
In Gemfile,
gem "backup", :git => "git://github.com/tenmiles/backup.git", :ref => "develop"
n local and in staging, bundle install did finish successfully. In production, when bundle install --deployment happens, bundler throws this error
Using backup (3.0.19) from git://github.com/tenmiles/backup.git (at develop)
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:365:in `initialize': No such file or directory - /home/anand/public_html/myapp/releases/20111113170352/vendor/bundle/ruby/1.9.1/bundler/gems/gems/backup-3.0.19/bin/backup (Errno::ENOENT)
I checked in /home/anand/public_html/myapp/releases/20111113170352/vendor/bundle/ruby/1.9.1/bundler/gems/gems/ and backup-150fb5168ebe is there! Its a gem installed via git. why is bundler looking for backup-3.0.19. How can I refresh backup gem and ask bundler to re install the gem from scratch.
Please help
Try this http://raflabs.com/blogs/silence-is-foo/2010/07/19/installing-a-gem-fork-from-github-source/ U can install the gem into your gem set by the method mentioned in there
I had this issue with 1.0.10, but when I updated the servers to bundler 1.0.21 the problem went away.
i have the some problem with current spork. If you specify a version it should work
gem "backup", '1.0', :git => "git://github.com/tenmiles/backup.git"
it fixed it for me