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

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

Related

Correct Ruby version, but can't init RNative project

✖ Installing Bundler
error Your RubyGems version (3.0.3.1) has a bug that prevents `required_ruby_version` from working for Bundler. Any scripts that use `gem install bundler` will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running `gem update --system 3.2.3`
Your Ruby version is 2.6.8, but your Gemfile specified 2.7.6
❯ ruby --version
ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [arm64-darwin21]
❯ which -a ruby
/Users/pc/.rvm/rubies/ruby-2.7.5/bin/ruby
/usr/bin/ruby

How to use gemset version of gem instead of default version?

I have set up rbenv and rbenv-gemset. I installed the Ruby and created the gemset.
Using OSX, there is the default version 1.17.2:
> gem list bundler
*** LOCAL GEMS ***
bundler (default: 1.17.2, 1.7.3)
I installed 1.7.3 with
> gem install bundler -v 1.7.3
Successfully installed bundler-1.7.3
1 gem installed
> rbenv rehash
> bundle -v
Bundler version 1.17.2
How to use 1.7.3?

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

The wrong Ruby version when working with cocoapod

Our project is written in Objective-C, and use an old version of cocoapod (0.38.0).
All my colleagues use the old version of Ruby (2.0.0).
I have the latest version of Ruby (2.3.1), so I need to install more the old Ruby version (2.0.0) as my colleagues have.
rvm install 2.0.0
rvm use 2.0.0
I cocoapod install
pod _0.38.0_ install
and get an error like this:
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
/usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:319:in `to_specs': Could not find 'cocoapods' (= 0.38.0) among 11 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/chipbk10/.rvm/gems/ruby-2.0.0-p648:/Users/chipbk10/.rvm/gems/ruby-2.0.0-p648#global', execute `gem env` for more information
from /usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/dependency.rb:328:in `to_spec'
from /usr/local/Cellar/ruby/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_gem.rb:65:in `gem'
from /usr/local/bin/pod:22:in `
I tried as suggested, but it doesn't help
gem pristine executable-hooks --version 1.3.2
gem pristine gem-wrappers --version 1.2.7
Another strange thing is in the error, there are different versions of Ruby appear: 2.0.0, 2.3.1, 2.3.0
This is all ruby versions I have
rvm list rubies
=* ruby-2.0.0-p648 [ x86_64 ]
ruby-2.3.1 [ x86_64 ]
my cocoapod version is
pod --version
1.0.1
Probably you have ruby 2.3.0 installed with system and versions 2.0.0 and 2.3.1 installed in rvm. Ruby 2.3.0 is first in PATH variables list than rvm one, so system sees it.
If it won't help please provide results of "which ruby" and "echo $PATH".

Cannot find gem after bundle install

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

Resources