Ignoring GEM because its extensions are not built - ruby

On both my work and home computers, I recently upgraded Ruby to 2.3.1, using ruby-install. I use chruby as my Ruby switcher.
I started seeing this warning in my terminal:
Ignoring bcrypt-3.1.11 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.11
Ignoring bcrypt-3.1.10 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.10
Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2
Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5
Ignoring byebug-5.0.0 because its extensions are not built. Try: gem pristine byebug --version 5.0.0
Ignoring concurrent-ruby-ext-1.0.2 because its extensions are not built. Try: gem pristine concurrent-ruby-ext --version 1.0.2
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2
On my work, computer, the list was much longer, but easy to resolve. When I tried the suggested gem pristine GEM, it told me it couldn't find the gem, so I ran gem install GEM, and that solved it.
At home, nothing is working.
Things I have tried, from common sense and various other Stack questions:
gem pristine GEM
gem pristine --all
uninstalling and reinstalling the gem
gem update
gem update --system
bundle update
uninstalling and reinstalling bundler
uninstalling and reinstalling rails (Though, it's not a Rails specific problem.)
deleting ~/.bundle/
opening XCode and letting it install some extensions (It did need to do it, but it didn't fix anything.)
running brew doctor and solving all the minor issues, then brew update and brew upgrade
gem install curb (I can't imagine what this gem has to do with this issue, but two different people listed it as the last step of their fix to the same warning.)

I came across this exact issue today - getting warnings like this for gems that weren't even installed!
... Well, it turns out the gems were installed - for a different ruby than the one I had set active with chruby (2.2.3 vs 2.3.1).
Switching to all the different rubies and running gem pristine --all on all of them solved the problem.

I ran into this issue and followed all the same commands as above, even going so far as to remove all my previously installed Ruby versions. However, the error persisted.
Turns out, there were some leftover gems for the various (previously uninstalled) versions in ~/.gem/ruby/. After removing the folders I no longer used, the errors disappeared.

I've had this problem today too and it frustrated because I couldn't type because my whole editor flashed red with error messages.
I'm not entirely sure what exactly caused it but I believe it's because we have multiple ruby versions OR multiple ruby version managers installed and they overwrite each other and otherwise mess up your paths towards the gems.
The gem command also gets overwritten when you have rbenv and rvm.
See which ones you've installed by typing;
which rvm
which rbenv
which chruby
If one of those is installed it'll return a path. Then delete them, make sure to completely clean out all the directories and start with a clean install.
Remove
Here's what I did for rvm;
rvm implode
gem uninstall rvm
rm -rf ~/.rvm
rm -rf ~/.rvmrc
Here's what I did for rbenv
First installed https://github.com/meowsus/rbenv-clean, then
rbenv clean
sudo apt-get remove rbenv
rm -rf ~/.rbenv
Reinstall
Then you have a clean home directory to work from. I reïnstalled rbenv with How to install Ruby 2.1.4 on Ubuntu 14.04. And finally;
rbenv rehash

In my case the warning itself has suggested the solution , so I just run them one by one.
Ignoring bigdecimal-2.0.0 because its extensions are not built. Try: gem pristine bigdecimal --version 2.0.0
Ignoring date-3.0.1 because its extensions are not built. Try: gem pristine date --version 3.0.1
Ignoring dbm-1.1.0 because its extensions are not built. Try: gem pristine dbm --version 1.1.0
Ignoring etc-1.1.0 because its extensions are not built. Try: gem pristine etc --version 1.1.0
Here an example:
gem pristine bigdecimal --version 2.0.0
so running the command of each line has solved my problem.

I did everything mentioned above including
xcode-select --install
reinstall ruby
reinstall all gems
gem pristine --all
but the issue was the same for me.
I just rebooted my Mac as the last hope, and the warning messages are disappeared.
Weird, but if anyone's struggling with this issue after trying everything on StackOverflow, try reboot your machine.

Running gem pristine --all didn't help at first, but then I realized: the script I was running began with the line:
#!/usr/bin/ruby
On my macOS system (Catalina, but I don't think it matters), this points to the Ruby that came with the system, not the one installed by RVM. Running gem pristine --all was fixing up the RVM installation, but my script was calling a different version of Ruby.
The fix for me was to use the env command to call whichever Ruby is specified in the current shell's PATH. Changing the top line of the script to this fixed it:
#!/usr/bin/env ruby

Adding my own flavor here. I use rbenv installed via Homebrew and was getting four of these "ignoring... extensions not built" messages. Specifically:
Ignoring bcrypt-3.1.12 because its extensions are not built. Try: gem pristine bcrypt --version 3.1.12
Ignoring bindex-0.5.0 because its extensions are not built. Try: gem pristine bindex --version 0.5.0
Ignoring bootsnap-1.3.2 because its extensions are not built. Try: gem pristine bootsnap --version 1.3.2
Ignoring byebug-10.0.2 because its extensions are not built. Try: gem pristine byebug --version 10.0.2
I tried many things in this thread with no luck. Finally in my case I did:
brew uninstall rbenv
rm -rf ~/.rbenv
brew install rbenv
At this point I was still getting the errors, but now I had only a single Ruby version to contend with:
$ rbenv versions
* system (set by /Users/will/.rbenv/version)
At this point I tried sudo gem pristine --all but was rejected for permissions on the system Gems directory.
So I went through and ran pristine on each gem, like
sudo gem pristine bcrypt --version 3.1.12 (etc)
And finally the errors were gone.

If you have installed RVM, possible you're catching the error because you have installed different versions.
Check and remove useless versions,
but I think this is not good approach.
Anyway errors gone.
rvm list
rvm use ruby-version
rvm remove ruby-useless-version
After refresh cocoapods, it should be injected in .rvm GEM_HOME
gem uninstall cocoapods
gem install cocoapods
Probably pod COMMAND will throw the error about minitest gem, so – gem install minitest

Running Mac OS Catalina, brew and rbenv ...
Having come across this exact problem today, and gone through all the answers here I eventually stumbled across another reason for this error:
Ignoring nokogiri 1.10.7 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.7
And of course gem pristine did no work.
My problem was a hard coded GEM_HOME and GEM_PATH environment variables which were overriding rbenv.
So, check that you haven't set GEM_PATH and GEM_HOME in ~/.zshrc

TL;DR - Ruby gems don't like Rubies running from symlinks or moved from where they were built (because of embedded shebangs)
If the Ruby directory is invoked or environment vars point to a symlink'ed directory, or are copied or renamed, this message is likely. I am using chruby and was symlinking /opt/rubies/ -> /usr/local/ruby/, but Ruby's dynamic library-finding logic doesn't play well with this.
The solution in my case was to replace the symlink with actual rubies in /opt/rubies/ and run gem pristine --all in each Ruby. For others using RVM or Rbenv, good luck with that without starting over from scratch.
This may not be your exact issue, but hopefully it helps.

This is an old thread, but I just came across this issue myself.
You don't need to restart your machine, you just need to refresh your environment, you can do this with the rehash command:
rehash
From the man page: rehash command re-computes the internal hash table of the contents of directories listed in the path environmental variable to account for new commands added.

Most comments here are on the right track. This problem often occurs after a Ruby version upgrade. I reviewed the gem command code and here is the gist of it.
Extensions are compiled into the gems/gem/ext subdirectory of the gems home directory. For example, on my Cygwin installation (and similarly under Raspbian), the BigDecimal extension is compiled into
/usr/share/gems/gems/bigdecimal-1.3.5/ext/bigdecimal/bigdecimal.so.
However, this is not where the extension is referenced when executed - that is from
/usr/lib/gems/ruby/ver/gem. Again using BigDecimal, the extension file when executed is loaded from
/usr/lib/gems/ruby/2.3.0/bigdecimal-1.3.5/bigdecimal.so
Here is the key: in this same directory, there is an empty tag file
/usr/lib/gems/ruby/2.3.0/bigdecimal-1.3.5/gem.build_complete
When the gem command starts up, it refers to the gems/specifications directory to get a list of installed gems and information as to whether they have extensions. If a gem does have extensions, gem (among other sanity checks) looks for the tag file gem.build_complete. If that is not found, it emits the error message "Ignoring gem because its extensions are not built".
Any action which rebuilds all extensions will fix this problem. Or, as total hack, if you in a hurry and brave, you can try copying all contents of /usr/lib/gems/ruby/oldver to /usr/lib/gems/ruby/newver e.g.
cd /usr/lib/gems/ruby
cp -nv 2.3.0/* 2.6

This is also a problem when you're developing on Mac and then build a Docker image:
https://forums.aws.amazon.com/thread.jspa?messageID=879802&tstart=0
When you do a "bundle install --deployment", bundler will create a
vendor directory w/ your gems in it. Note that whilst this includes
your gems in the local folder, it will only include the native
extensions for your platform. As you're on macOS this will be Darwin.
You'll need to do repeat the process on a 64-bit x86 linux
environment.

Libby's suggestion to just start a new terminal session (which she commented on Sebastian Kim's answer) worked for me. Much quicker than any of the others too so I wanted to make it an answer so it was more visible.

I had this problem but only when I was starting tmux session using tmuxinator.
Turned out it's because I'm using tmuxinator from brew instead of installing it using gem install. Maybe using chruby at the same time contributed to the problem as well.
p/s: I also removed unused ruby from ~/.gem/ruby but I doubt that's the reason this issue was resolved for me.

Uninstall and reinstall of Vagrant also works. There's an unistall.tool bash script included in the installer .dmg image that will remove Vagrant.
Found this solution here: Updating Vagrant and Gems Extentions Not Built In

I had the same issue and I'm using rbenv. For some reason my global rbenv setting went missing. In order to fix this problem I set the global version to one of my rbenv versions... for instance:
rbenv global 2.5.1

On my case I was trying to run pristine --all but I was getting:
Ignoring ffi-1.11.1 because its extensions are not built. Try: gem pristine ffi --version 1.11.1
Ignoring jaro_winkler-1.5.3 because its extensions are not built. Try: gem pristine jaro_winkler --version 1.5.3
Ignoring psych-3.1.0 because its extensions are not built. Try: gem pristine psych --version 3.1.0
/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': incompatible library version - /.gem/gems/psych-3.1.0/lib/psych.bundle (fatal)
Then, I deleted the content on Users/{{user.name}}⁩/⁨.gem⁩ then as I needed to run bundle install --force, it reinstalled everything, then the command pristine --all worked as expected

This solution worked for me for RubyMine IntelliJ
I had two different terminals being used and RVM and ruby<Version>.
Solution:
I had to switch it to the RVM version for the errors to go away in Preferences>Languages&Frameworks>Ruby SDK
Errors:
Ignoring executable-hooks-1.6.0 because its extensions are not built. Try: gem pristine executable-hooks --version 1.6.0 rubymine
Ignoring gem-wrappers-1.4.0 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.4.0

If you are using rvm like me, the fix could a simple:
rvm get stable
rvm reload
As stated in this answer https://apple.stackexchange.com/a/192513

I have executed these commands in Terminal and worked for me:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install ruby, it may need sudo (sudo brew install ruby).
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
sudo gem pristine --all

In Ubuntu this worked for me.
source ~/.bash_profile
sudo gem pristine --all

Related

Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1

When I installed cocoa pods I got this message. The cocoa pods downloaded is in version 1.10.1. Ive tried to use the command they give but this appears:
Ignoring ffi-1.13.1 because its extensions are not built. Try: gem pristine ffi --version 1.13.1
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
Does it means that the latest version available is 1.13.1 but I can't use it because of a problem? How to solve it?
This solved the issue for me
brew install cocoapods
should already be linked (as pointed out by Raphael Pinel) but if you want to make sure run
brew link --overwrite cocoapods
Basically, you need to do what the warning message says: install the Gem "ffi" in the specified version by running gem pristine ffi --version 1.13.1. However, usually you don't have write permissions on the system to install a Gem into the stated directory.
You could probably just use sudo, i.e. run the command sudo gem pristine ffi --version 1.13.1 and enter the password, but I guess this is generally not recommended as it is a security risk.
I installed it like this:
gem install ffi --version 1.13.1 --user-install
Then I had to add the installation path to my PATH variable; in my case I added this line to my ~/.zshrc:
export PATH=$HOME/.gem/ruby/2.6.0/bin:$PATH
I'm really not an expert on Ruby stuff, but this solved the issue for me.
This worked for me :
sudo gem pristine ffi (don't write a version here, because it will fix the problem of all versions)
then :
pod install
MacOS: Ventura v13.0
Updating the Ruby version worked like a charm. Did the following steps.
$ brew install rbenv
Installed the latest ruby version.
$ rbenv install 3.1.2
To activate the above version as global default version.
$rbenv global 3.1.2
To install ffi
$ sudo gem install ffi --version 1.15.5 --user-install
in my case ( mbpm1 pro ) , my other project are fine , but some project from my friend ( windows only) i got some issue , i fixed by
arch -x86_64 sudo gem install ffi
flutter clean dont forget to clean after installing some gem
flutter pub get re get
run now ( these run would automatically run pod install ) just click on main.dart ( vscode )
None of the answers worked for me. So, I thought of uninstalling all versions of ruby which I had unknowingly installed, and keeping only the one installed by Xcode.
brew uninstall --force ruby
Then, uninstalled cocoapods
brew uninstall --force cocoapods
I was left with the ruby installed by XCode. I ran:
gem pristine ffi --version 1.15.3
I realised the other versions got installed in ~/.local
I deleted the whole folder as it had nothing other than the old gem folder
rm -rf ~/.local
Now, reinstall cocoapods:
brew install cocoapods
Try running:
pod install
OR
gem -v
You should not see this error.
This usually happens when you have multiple gem versions installed and the path is incorrect.
P.S I am using macOS Monterey 12.1
My issue was that the pre installed ruby had those extensions installed and caused the error messages. Run the command below to
see all installed packages. Said command should also print the error Ignoring ... because its extensions are not built. Directly reference /usr/bin/gem since you might have ruby installed via brew which would be called otherwise.
/usr/bin/gem list
Then manually uninstall all mentioned extensions for the default ruby.
sudo /usr/bin/gem uninstall ffi
In my case I had paths mismatch, this command helped me:
rvm get stable --auto-dotfiles
Also check paths order in you .zshrc file
f.e.
# Ruby
export PATH="~/.rvm/gems/ruby-2.6.0/bin:$PATH"
export PATH="/usr/local/opt/ruby/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
export PKG_CONFIG_PATH="/usr/local/opt/ruby/lib/pkgconfig"
# User local
export PATH="/usr/local/bin:$PATH"
gem install cocoapods
This is a workaround and not a solution, but for me, after trying all other posted solutions (on Monterey 13.0.1, I traced it back to it seemingly picking the homebrew installed cocoapods picking up the ffi library from ~/.rbenv/shims, with the only timely work around being to install cocoapods via gem, per above.
All this said, I don't claim to be well versed in rbenv, or any other dependency manager, for that matter.
I'd love to know a better answer that didn't bork the homebrew based installation.
Start the Terminal on a Mac M1 with Rosetta and run
pod update

Vagrant can't see my rbenv gems

I removed an old copy of vagrant according to the official HashiCorp docs, and reinstalled using the official OSX universal installer. Now, every vagrant command on the host returns the following warning:
$ vagrant global-status
Ignoring ffi-1.9.10 because its extensions are not built. Try: gem pristine ffi --version 1.9.10
I doublechecked my Ruby setup, and found RVM and rbenv both installed. So, I uninstalled RVM with rvm implode, and deleted ~/.rvm for good measure. Lastly, I installed Ruby 2.3.0 with rbenv, and called rbenv init (and added its output to my shell config).
From here, I have a setup that will let me install any version of ffi. The latest version is newer than 1.9.10, but installing 1.9.10 doesn't affect the warning.
I assume lacking FFI is going to slow things way down. How do I get Vagrant to use the rbenv-managed gems?

'bundle exec' complains about gem not being installed, even after 'bundle install'

I have a website using Jekyll with Github Pages. After previously messing about with versions and RVM on another computer, on this one I opted to stick with just one version of Ruby and per-project environments using bundler.
I have a pretty simple Gemfile:
[$]> cat Gemfile
source 'https://rubygems.org'
gem 'github-pages'
and bundler config:
[$]> cat .bundle/config
---
BUNDLE_PATH: env
BUNDLE_DISABLE_SHARED_GEMS: '1'
When I run any command (jekyll, gem, irb) through bundle exec, I get a dependency error:
[$]> bundle exec jekyll
Could not find RedCloth-4.2.9 in any of the sources
Run `bundle install` to install missing gems.
However, the bundle is already installed:
[$]> bundle install
Using RedCloth 4.2.9
Using i18n 0.6.11
Using json 1.8.1
[snip]
Using github-pages 29
Using bundler 1.7.7
Your bundle is complete!
It was installed into ./env
I'm at a bit of a loss as to how bundler can think the gems are installed when using one subcommand, but think they're missing when using another.
[$]> which ruby
/usr/local/bin/ruby
[$]> which bundler
/usr/local/bin/bundler
[$]> ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin14]
[$]> bundler --version
Bundler version 1.7.7
After deleting the env directory and reinstalling, I noticed it created subdirectories for two Ruby versions - 2.1.0 and 2.2.0. The latter was my current version of Ruby, but the directory was empty (all the gems were installed into the env/ruby/2.1.0/gems directory). This, combined with Oliver's answer about rbenv, got me thinking about mismatched versions.
I reinstalled bundler with a simple gem install bundler, reran bundle install, and all is good.
It seems in general the answer is to sort out issues with bundler installing for a different version of Ruby than you're actually using. It seems strange to me it would use one thing for bundle install and another for bundle exec, but *shrug* whatever.
I had exactly the same problem after installing rbenv as my Ruby manager. In the end I solved the problem with:
rbenv rehash
(additionally you may need to restart terminal, as per #joel-glovier's comment)
That fact it's complaining about Redcloth 4.2.9 is actually a red herring. Bundler probably can't find any of the gems but Redcloth is the first one it looks for and so it exits imediately with that error.
Basically I'd installed rbenv and ruby 2.2.2 and changed to that version with rbenv global 2.2.2 but I'd forgotten to run rbenv rehash. So I'm guessing when running bundle install it was looking at my previously used version of ruby (system ruby) to see what gems were installed but when running bundle exec jekyll serve it was looking at my new ruby version and not finding any of the gems.
I had to open ./.bundle/config and set
BUNDLE_DISABLE_SHARED_GEMS to true for bundle the gems to be properly locally stored.
I had defined BUNDLE_GEMFILE = /home/app/current/Gemfile in .bashrc file. That broke the bundle exec while deploying a new version to the server. Check with env that you don't have the BUNDLE_GEMFILE defined in your environment variables.
I added the BUNDLE_GEMFILE into the .bashrc file to ease with monit commands. Now I just define the variable in the beginning of the monit command.

Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0

When I try to bundle install I get the following message:
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0
In my Gemfile I have the following:
ruby '2.1.0'
And when I run ruby -v in the console I get:
ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin12.0]
What does Ruby 2.1.0p0 mean? What version should I have in my Gemfile and why does the error tell me I have Ruby version 2.0.0?
Run
gem install bundler
or
gem update bundler
which may fix your problem.
For all new installed versions of Ruby you should update or install a new bundler.
In the top-level directory of your project, create a file named .ruby-version containing (wait for it...)
2.1.0
That apparently is the cross-{rbenv,rvm} way of spec'ing the version now.
For me, none of the answers helped. I fixed it closing and opening again the terminal.
If you get this in a Rails project, and you recently upgraded your Ruby version you might have spring still running with the old version of Ruby.
./bin/spring stop
will fix this.
None of the other suggestions was working for me. On the server, I had to do:
rvm --default use [correct version number]
brew cleanup ruby worked for me as I use HomeBrew to install Ruby.
I recently updated Ruby through HomeBrew but HomeBrew did not remove the older version. brew cleanup ruby will delete the older version of Ruby.
the main reason for this problem is your machine and gemfile using a different ruby version
so there is multiple problems and solutions for this issue you can try the below solutions one by one
1- make sure your machine install and use the same version of your gemfile if your machine not using the same one try to install this version using rvm
$ rvm install ruby_version_you_want
make sure the version installed success by using this command
$ rvm list
and if the new version doesn't set as a default you can set it using this command
$ rvm --default use ruby_version_you_want
you can check the current ruby version
$ rvm current
$ ruby -v
2- if you have the same issue check your bundler
$ gem install bundler
or
$ gem update bundler
3- in some cases spring still using the old version so you need to stop it
$ ./bin/spring stop
4- another case you can type
$ gem pristine --all
and try to install bundle again
5- also in some cases after install the updated ruby version you just need to restart your terminal.
6- another solution but I didn't recommend it the top-level directory of your project, create a file named .ruby-version containing your active running ruby version
7- if you still have this problem try to remove ruby and install the updated version only
$ aptitude purge ruby
If you are using Capistrano you should also check your deploy.rb file for the set :rbenv_ruby configuration.
I got this after upgrading with ruby-install. Fixed this with:
gem install bundler
followed by:
$HOME/.rubies/ruby-2.4.1/bin/bundle
It shouldn't be necessary to specify the path as which bundle indicates it's already using this path. But it gives the version error if running bundle without the path. I don't know why?
Thanks for the info about installing / updating bundler but it didn't work for me.
I had to do rbenv rehash
If you are using rbenv to manage your ruby environments you can run rbenv local 2.1.0 within your project directory to set the version of ruby your gemfile asks for.
NONE of the above answers worked for me, but
$ gem pristine --all
did the trick for me
buona fortuna
I struggled with something very similar, just different versions. I finally fixed it by going to RubyGems and placing the latest version of bundler in my gemfile, which currently is:
gem 'bundler', '~> 2.1', '>= 2.1.4'
There was still an issue, but after that, I ran:
gem update --system
And it resolved the mixed-up versions of Ruby in the rails project folder. You may have to restart the terminal before you do this. Also, I commented out the bundler gem file, it appears the gem update --system command is what really resolved it.
I got it from here:
For more advanced projects .versions.conf is supported, where more than the Ruby version can be specified.
Generating .versions.conf:
rvm --create --versions-conf use 1.9.3#my_app
Example .versions.conf:
ruby=jruby-1.6.8
ruby-gemset=my_app
env-JRUBY_OPTS=--1.9
Make sure your server configuration points to the correct ruby installation.
I had already updated my Ruby version in the .ruby-version file and that didn't fix it. ruby -v also showed the correct version, but I had forgotten to update my server config.
For example, with rbenv, NGINX, and Pushion Passenger I had in my NGINX server block:
passenger_ruby /Users/myusername/.rbenv/versions/2.3.1/bin/ruby;
And I needed to change to...
passenger_ruby /Users/myusername/.rbenv/versions/2.3.3/bin/ruby;
Then restarted NGINX and it worked.
This could happen when you install new version of ruby and update .ruby-version and Gemfile to the new version without doing install all the gems for new version of ruby first. So do the
$ bundle install
and you might as well need to source .profile or restart your shell.
If you are using rbenv just run
rbenv local 2.0.0
Then
bundle install
I opened Gemfile and replaced 2.7.1 with my own version of ruby 2.7.0 Everything is okay right now.
Had the same problem and I'm working with rbenv
Those are the steps that helped me fix my problem:
First in terminal, type which bundle. For me this gave: /usr/local/bin/bundle
Again in terminal try which ruby. In my case this gave: /Users/Mahmoud/.rbenv/shims/ruby
The problem here thus is that bundle isn't using the same ruby version from rbenv. So the path needs fixing. In other words I need to tell my terminal to use the rbenv version of bundle when I use bundle install.
So step 3: For me I personally already had the path set in ~/.bash_profile:
export PATH="$HOME/.rbenv/shims:$PATH"
eval "$(rbenv init -)"
but apparently this was not enough as I was using zsh. Had to add those same 2 lines to ~/.zshrc as well.
Restart terminal
Now bundle install is working as expected and which bundle gives:
/Users/Mahmoud/.rbenv/shims/bundle
indicating that the problem was just that bundle was using the wrong ruby.
So if you have this problem, just make sure ~/.bash_profile and ~/.zshrc have the correct path by adding the 2 lines indicated above. If this didnt work take a deep dive into paths to make sure that before starting which bundle gives the equivalent of:
/Users/Mahmoud/.rbenv/shims/bundle
Had the same error. Doing the following fixed it. I was using ruby 2.5.5 and rbenv. Upgraded from 2.5.1.
rbenv rehash
gem uninstall bundler
gem install bundler
gem install bundler:1.17.3 (my app needed specific bundler -v 1.17.3)
gem install rails
I solved this problem by updating my ruby version to ruby '2.4.0'
Then bundle install
Simply closing the terminal I was working on and opening a new one worked for me. Sometimes, updates are not effected immediately until a session is closed. I have found this as the case with many rails errors I faced.
I clean and install with that:
sudo gem pristine --all
and install again:
bundle install
I face the error msg
Your Ruby version is 2.5.1, but your Gemfile specified 2.3.0
and solved by the following steps:
open Gemfile which located at your directory.
change ruby '2.3.0' to ruby '2.5.1' and save the Gemfile
go back to items and run bundle update.
the issue is perfectly solved.

How do you uninstall RVM gem?

Strange... but this is what I got :
$ gem list | grep rvm
>> rvm (1.11.3.3)
$ gem uninstall rvm
>> INFO: gem "rvm" is not installed
How can that be possible? The root of this problem probably stems from me downloading the latest RVM and finding that it does not work with the latest version of POW. Thus I had to implode RVM and reinstall an older version. Since then when I do a cap deploy, I get the classic :
`<top (required)>': RVM - Capistrano integration was extracted to a separate gem, install: `gem install rvm-capistrano` and remove the `$LOAD_PATH.unshift` line, note also the 'set :rvm_type, :user' is now the default (instead of :system). (RuntimeError)
Any ideas?
I recently encountered the same rvm error:
"RVM - Capistrano integration was extracted to a separate gem, install: gem install rvm-capistrano and remove the $LOAD_PATH.unshift line, note also the 'set :rvm_type, :user' is now the default (instead of :system). (RuntimeError)"
Doing what the error suggested did not work for me at all.
What did work for me was to do: rvm -v
When I did this I saw that my rvm version was rvm 1.13.0
Using "rvm get" I did "rvm get 1.12.0" but still got the error
Then I tried "rvm get 1.11.0" and then presto, my rvm started working again.
I'm not 100% sure what caused the error in the first place but I think it all began when I tried to upgrade rvm with rvm get stable after I was unable to install some gems. I found out that I wasn't able to install gems anymore due to the fact that I had updated my xcode to 4.3.2 and apparently Apple changed their c complier which doesn't play nice with rvm.
Hope this helps someone.
Are you in a gemset? If so, that gem might be in the interpreter's unnamed gemset or the global gemset. If so, try
rvm use 1.9.3
gem uninstall rvm
or
rvm use 1.9.3#global
gem uninstall rvm
I just ran into this error as well. The error you ran into was because of the recent capistrano update. If you add rvm-capistrano to your gemfile and remove the $LOAD-PATH.unshift line from your capistrano deployment file it should work, at least it did for me.
That would be correct. Its in the 'global' gemset. This gemset is 'mixed in' to both the 'default' gemset and any gemsets you actually create.
Thus if you have Ruby 1.9.3 installed, for example, (rvm install 1.9.3) it will be installed into that ruby's 'global'. You can verify this by doing 'gem list rvm -dl' which will show you the name, version, description, and location on the disk of the requested gem.
∴ gem list rvm -dl
*** LOCAL GEMS ***
rvm (1.11.3.3)
Authors: Wayne E. Seguin, Michal Papis
Homepage: https://rvm.beginrescueend.com/
Installed at: /home/me/.rvm/gems/ruby-1.9.3-p194#global
RVM Ruby Gem Library
∴
I don't know why you want it removed, but you would do as Abe stated as the second choice.
To give more details, RVM works with POW, this is known issue: https://github.com/37signals/pow/issues/271
the easiest solution(in project dir):
rvm env . > .powenv
The version of RVM might not be compatible with POW. You can remove RVM and then install the most current version.
The problem is that RVM 1.12 and up does not play well with Capistrano.
So uninstall your RVM, then get RVM 1.11 (rvm get 1.11.0).
Nathan got it right: https://stackoverflow.com/a/10306090/294449
You used to have to do the unshift in your deploy.rb but the latest versions of RVM have made that hack no longer necessary. Just remove it and add the rvm-capistrano gem to your Gemfile. It works like a charm.

Resources