I have a gemfile.lock which requires Bundle 2.2.19 . My system has Bundle 1.11.2. Now I ran the following commands:
gem update --system
sudo gem install bundler
Has the following output:
Successfully installed bundler-2.2.31.gem
But after that, I do:
Bundler --version
I still get
Bundler version 1.11.2
And if I try to do
bundle install
I get
You must use Bundler 2 or greater with this lock file
I also tried running
bundler update --bundler
But that does not work either. I also tried uninstalling and reinstalling but while uninstalling, it only uninstalls the 2.2.31 version. Also tried something like
bundle _2.2.31_ install
But it says could not find command. Any suggestions are welcome.
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
When trying to bundle install on a Gemfile that contained only the GitHub Pages gem and nothing else, on Ubuntu 18.04, I got error messages telling me to try installing eventmachine using gem install. That always succeeds, but bundle install still fails. How can I get bundler to see that the gem is installed?
I fixed this after many hours of struggle, by noticing that on the GitHub Pages repo there's a note that says
Important: Make sure you have Bundler > v1.14 by running gem update bundler in your terminal before following the next steps.
I have no idea why this mattered but I removed my ruby packages from Ubuntu and reinstalled them, then installed bundler with rubygems, which gave me a newer version:
sudo apt-get remove ruby
sudo apt-get install ruby ruby-dev
sudo gem install bundler
bundler --version
If anyone knows why I needed that version of bundler, or how I should have diagnosed this faster, I'd be interested to hear it. I'm not new to programming but I'm new to Ruby.
From my understanding it might be the gem you are trying to install requires a specific feature provided by bundler. If you check the change log of bundler there is some changes related to install github based gems on how to correctly read the user git settings. So I think that might be where the problem is from.
I'm using Ubuntu 16.10 and was updating my Gitlab from 6.8 to 7 and everything went wrong. Now I have removed it and is trying to install a new version but ran into a problem with Ruby.
When I try install it
$ sudo apt install gitlab
I get an error after some time:
Could not find gem 'rails (>= 4.2.7.1, ~> 4.2.7)' in any of the gem sources
listed in your Gemfile.
I have tried to run
$ sudo gem install rails
but this gives me another error:
ERROR: Error installing rails:
activesupport requires Ruby version >= 2.2.2.
I don't know what to do now...
I have started all over... Removed gitlab* and postgresql. Rebooted and installed gitlab again. Now I got another error:
Could not find gem 'pg (~> 0.18.2)' in any of the gem sources listed in your Gemfile.
Tried to install pg manually:
$ sudo gem install pg
Successfully installed pg-0.20.0
But still sudo apt upgrade gives the same error: "Could not find gem 'pg'
You may be missing a hidden dependency. Try the following:
sudo apt-get install libpq-dev
I gave up! I reinstalled the Linux server with the Linux LTS version and used the Omnibus package installation..
Problem solved!
I have problem installing devdocs in my mac.
I tried to do the steps there but I'm stucked installing bundler.
I tried the following in the terminal:
gem install bundler //this worked
bundle install //this prints error: Bundler::GemfileNotFound
I already have the latest Ruby version required but still printing the same error.
I tried to execute bundle install in the path where the gemfile is still the same error.
I needed to install this in my pc for offline browsing. For those who successfully installed this in their mac machine, please help me.
This error indicates that you're trying to run the command in a directory that does not contain any Gemfile. I think that in your local directory, you forgot to clone the devdocs Git repo. So go to your local devdocs directory and type:
git clone https://github.com/Thibaut/devdocs
Then go to this directory, and type the following commands:
bundle install
thor docs:download --all
rackup
That should work, and devdocs should be available at localhost:9292. If that does not, maybe your ruby version is too old (devdocs requires Ruby 2.1.0 or greater). In this case, I strongly recommend you to us rvm to update ruby (rvm install ruby-2.1.0).