How to use the master version of bundler - ruby-on-rails

I am curious about how bundler (https://github.com/carlhuda/bundler) works. So I cloned the repository. However I am not able to figure out what I need to do so that when I do bundle install ruby should use the bundler which I have cloned and not the gem already installed.
I guess I need to add my repo path somewhere so that when ruby is looking for bundler it picks up cloned bundler and not the gem bundler.
I tried a few things. but nothing worked. I use rvm.

just do
gem build bundler.gemspec
which generates a .gem file and install this with rubygems
gem install bundler-1.1.0.gem
than you are using your own fork of bundler

Related

rails bundler version issue

I have rails project working on Ubuntu.
Now I installed WSL on another machine and cloned the very same project.
Now when I try to install bundler with
gem install bundler
it installed bundler 2.0.2 and on bundle install it gives error:
Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails (~> 5.0.0)'
Now I looked at the gemfile.lock it was bundled with 1.16.4, I installed it with
gem install bundler -v '1.16.4'
Now I do a simple bundle install, then it uses 2.0.2, so I have to do
bundle _1.16.4_ install
It completed successfully, but now when I am trying to do rails db:create, it says
The git source https://github.com/activerecord-hackery/ransack.git is not yet checked out. Please run bundle install before trying to start your application
What's wrong here?
Uninstall bundler 2.0.2:
gem uninstall bundler -v 2.0.2
If you still have problem, you can use:
bundle exec rails db:create
You can update to using bundler 2.x if possible with:
bundle update --bundler
This will change the BUNDLED_WITH version in Gemfile.lock.
see: https://bundler.io/guides/bundler_2_upgrade.html
You could also set the default bundler version:
bundler config default 1.16.4
gem list bundler
However I have found this to be a bit error prone.
Try to remove all your gems (go to the gems folder of your ruby, remove the specifications folder and the gems folder),
gem list should be more or less empty
gem install bundler
And try to bundle install again from scratch.

Bundler could not find compatible versions for gem "bundler" asking me for the incompatible versions of the bundler i have and the bundler required

I am new to ruby on rails and trying to install the bundle in my rails app and getting the same error this whole time ..
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
bundler (= 1.0.18) ruby
Current Bundler version:
bundler (1.7.4)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?
I have tried almost each suggestions that've been suggested but none so far worked for me.
Can anybody help..??
Thank you in advance..
Usually, Bundler does not need to be on Gemfile.
You can remove the line that contains bundler in Gemfile, then run bundle again.
The reason this is failing is because your system has probably a newer version of bundler than the Gemfile is asking for.

Remove gem installed via Bundler from Git/Github

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).

Could not find RubyGem bundler

I've cloned diaspora for github, git://github.com/diaspora/diaspora.git
I tried to install it. An error generated when I use bundle install.
$ bundle install
/usr/local/lib/site_ruby/1.8/rubygems.rb:812:in `report_activate_error': Could not find RubyGem bundler (>= 0) (Gem::LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems.rb:223:in `activate'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1146:in `gem'
from /usr/bin/bundle:18
I'm using rails 3 and ruby 1.8 on ubuntu 11.04. How to fix it? Please help
Did you install bundler gem?
$ gem install bundler
You might need sudo privileges.
Hmm, maybe you've got the bundle command and bundler gem installed for /usr/bin/ruby, and after that installed another Ruby in /usr/local/bin/ruby?
Could you do a which ruby and head -1 /usr/bin/bundle? Maybe also a gem list?
Presumably this has been fixed long ago, but for the benefit of others....
My issues was that while I had installed the bundler gem it had been installed in a different location to the current GEM_PATH - so it couldn't be found.
So,
GEM_PATH=/usr/lib/ruby/gems/1.8/ bundle install
did the business, setting the value of GEM_PATH to the actual location of the gems folder where the bundler gem has been installed.

How do I install forked gems on heroku?

I'm trying to get Heroku working with European buckets on amazon s3 webserivces using the aws-s3 gem. It seems I need to install a forked version of the gem to get around the issue. However, with heroku I can only use the .gems file to install gems.
Can I use this .gems file to install forked-gems somehow?
Unpack the gem in your local repository, then add it to your git repository. This will copy the gem to your vendor/gems directory. Also remember to remove the gem from your .gems list to prevent Heroku from using the unwanted version.
#Unpacks all gems
rake gems:unpack
#Unpack a specific gem
rake gems:unpack GEM=xxxxx
Heroku already supports Bundler even for not-Rails 3 application.
http://blog.heroku.com/archives/2010/2/17/gem_bundler_on_heroku/
You can switch to Bundler and use its syntax to have Bundler downloading the Gem from the fork.

Resources