Cannot find gem after bundle install - ruby

I'm trying to setup my environment to do development on Travis CI's dpl project.
I installed rbenv to manage my Ruby versions and I use Ruby 2.2.3.
Then I do bundle install and the gems are installed.
Then when I try to do bundle exec rake I get this error:
Could not find CFPropertyList-2.2.8 in any of the sources
Run `bundle install` to install missing gems.
This gem is installed. Can you tell me why it is not found by Bundler?
Here is a gist of the output of my commands: https://gist.github.com/cotsog/7bb87c84a636bcd3de65
Thanks for your help!
Update:
Additional info about my environment:
$ which ruby
/Users/me/.rbenv/shims/ruby
$ which bundler
/usr/bin/bundler
$ ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
$ bundler --version
Bundler version 1.10.6

Related

Ruby: Bundler version does not match bundler version

I'm just trying to use bundler 2.3.25 to bundle my gems. And I currently have Ruby 2.7.0
And I've uninstalled Bundler version 2.4.5
When I ask for the version of bundler I have installed, I get different results which is causing issues.
Currently my Gemfile.lock file is bundled with 2.4.5 - which is not installed
When I do bundle show I get * bundler (2.4.5) - again, not installed
When I do bundle -v I get Bundler version 2.4.5 finally, yep still not installed
When I do bundle _2.3.25_ -v it returns Bundler version 2.4.5
But when I do gem list bundler I get bundler (default: 2.3.25)
gem list bundle -d returns bundler (2.3.25)
When I delete my lock file and then do bundle _2.3.25_ install to re-generate the lock file, its bundled with 2.4.5
I've gone as far as to delete the file from
\\wsl$\Ubuntu\home\me\.rbenv\versions\2.7.0\lib\ruby\gems\2.7.0\gems\bundler-2.4.5
I do use rbenv and I wonder if that is forcing the issue, but I'm not sure.
When I run gem update --system I get:
Latest version already installed. Done.
When I bundle exec rake -P I get:
Gem::GemNotFoundException: can't find gem bundler (= 2.4.5) with executable bundle
I found this and ran it: which bundle
And it returned:
/home/todd/.rbenv/shims/bundle
I also ran this: eval "$(rbenv init -)" and it didn't do jack didly.

Rvm version error

I have installed many flavors of ruby on rvm, and using following command to change rvm ruby versions.
rvm use 1.9.3
then ruby -v gives me following result
ruby 1.9.3p551 (2014-11-13 revision 48407) [i686-linux]
but when i try to run any commands like rails s or bundle install
it gives me following error
Your Ruby version is 2.3.1, but your Gemfile specified 1.9.3
Using
rvm list
you can get list of ruby version on your system along with current & default versions.
If ruby version is not specified in Gemfile, then it is generally considering default rvm version.
But if it is specified in Gemfile, then that version of ruby should be installed in your system along with its bundler.
First make sure ruby version either installing or using it,
rvm install '1.9.3'
rvm use '1.9.3'
To install bundle of required ruby version, run this command
gem install bundler
That's can happens, when you trying to use fresh installed ruby without bundler, all newest installed ruby should also include bundler installation.
$> rvm use 1.9.3 && gem install bundler # may terminal reload needed
$> bundle install
$> bundle exec rails s

Bundler finds the wrong version of ruby

I'm using OS X 10.10.5 (Yosemite). I'm trying to clone the github repo for MacDown. The instructions in the README say that after cloning one should do
git submodule init
git submodule update
bundle install
bundle exec pod install
I'm not a ruby programmer, so I had to install Bundler. The first two steps ran fine, but when I tried to run bundle install I got the error
activesupport-5.0.0.1 requires ruby version >= 2.2.2, which is incompatible with the current version, ruby 2.0.0p481
So I tried brew install ruby and now I have
saul#miniMac ✓ ruby --version
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin14]
However, bundle install gives me the same error message as before. It's clear that it's finding the ruby at /usr/bin/ruby instead of the one at /usr/local/bin/ruby. How do I correct this?
I thought that perhaps the problem was that I had installed bundler before upgrading ruby, neither sudo gem uninstall bundler nor sudo gem uninstall bundle has any effect, and I don't know what else to try.
Here is all the output, in case it's relevant:
saul#miniMac ✓ bundle install
Fetching gem metadata from https://rubygems.org/..........
Fetching version metadata from https://rubygems.org/..
Fetching dependency metadata from https://rubygems.org/.
Resolving dependencies...
activesupport-5.0.0.1 requires ruby version >= 2.2.2, which is incompatible with
the current version, ruby 2.0.0p481
EDIT:
Thanks for the suggestions. I tried gem install bundler again, but it didn't help. I got the same error message. Here's what I get from bundle env
saul#miniMac ✗ bundle env
Environment
Bundler 1.13.6
Rubygems 2.0.14
Ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
Git 2.5.4 (Apple Git-61)
Gemfile
source 'https://rubygems.org'
gem 'cocoapods', '0.39.0'
Gemfile.lock
<No /Users/saul/Projects/macdown/Gemfile.lock found>
EDIT 2:
saul#miniMac ✓ which -a bundle
/usr/local/bin/bundle
/usr/bin/bundle
It seems that your PATH may have an entry that points to your older version of Ruby and despite having a newer version (2.3.1) it gets to use the first ruby binary it finds in one of the entries it finds in your PATH, which happens to be the old version. You could try to add your latest Ruby path as the first entry of your PATH variable, but in case a sub-shell is run and the default PATH is loaded the path to your latest Ruby would be overwritten. That being said, I think the easiest would be to use rvm here to make sure your environment is all set up with the version you intend to use at any given time. RVM can manage multiple versions of ruby in the same system. Read more about RVM here.
Run all the following commands in the same terminal window:
Install rvm: curl -sSL https://get.rvm.io | bash -s stable
Add rvm binary to PATH: export PATH="$PATH:$HOME/.rvm/bin"
Install ruby version you need: rvm install 2.3.1
Configure the current shell to use a specific version of Ruby like so: rvm use 2.3.1
Run bundle install again

Error ruby version When i'm running bundle install in Jekyll

I have reinstalled and updated my Ubuntu to 16.04, so now i have installed RVM for use Jekyll, but i have a problem when run bundle install of gemfile.
$ bundle install
Ignoring executable-hooks-1.3.2 because its extensions are not built.
Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Your Ruby version is 2.3.1, but your Gemfile specified 2.2.0
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
$ rvm gemset list
gemsets for ruby-2.2.0 (found in /home/kedinn/.rvm/gems/ruby-2.2.0)
No running because this 2.3.1, but your Gemfile specified 2.2.0 why? if i have using ruby-2.2.0
It looks like you have both RVM and rbenv installed, and they are probably in conflict. Since they do more or less the same things, it should be safe to get rid of one of them. It means the rbenv installation of ruby is broken.
sudo rm -rf ~/.rbenv
Try installing Ruby like this

How to install capistrano v2.13.5 with ruby 1.8.7?

I am using ruby 1.8.7 (2013-06-27 patchlevel 374) [i686-darwin14]. When I try to install the capistrano gem I get the following error:
sudo gem install capistrano -v2.13.5
ERROR: Error installing capistrano:
net-ssh requires Ruby version >= 2.0.
AFAIK capistrano 2.13.5 should be compatible with ruby 1.8.7
How can I install capistrano v2.13.5 with ruby 1.8.7 (<2.0) installed?
I have sorted this problem out manually installing the capistrano dependencies. Execute the following commands if you have the same problem:
sudo gem install net-sftp -v2.0.0
sudo gem install net-scp -v1.0.0
sudo gem install net-ssh-gateway -v1.1.0
sudo gem install capistrano -v2.13.5
I had the same error message when installing Capifony in Ubuntu 14.04.
I did this:
# gem install net-ssh -v 2.9.2
And then this:
# gem install capifony
It worked.
I found the solution described here.
Even after installing the dependancies the capistrano installation process was asking for net-ssh that required ruby >= 2.
I had to download the source that I wanted from https://github.com/capistrano/capistrano/releases. Unzip, cd into the directory, and run:
gem build capistrano.gemspec
gem install --local capistrano-2.15.5.gem
Capistrano is trying to install latest version of its dependency (net-ssh) which is not compatible with ruby versions prior v2.0. The solution is to install proper version of that dependency prior to installing capistrano. Proper version means the dependency is compatible with both Ruby and capistrano. In this case that is net-ssh v 2.6.5. So following sequence works:
gem install net-ssh -v 2.6.5
gem install capistrano -v 2.13.5

Resources