20

Getting this error doing a bundle install; google around seems like a common issue but I can't seem to find the fix (seem suggestion on Gemfile.lock but I moved that file to another directory)

# bundle install

Your bundle only supports platforms [] but your local platforms are ["ruby", "x86_64-linux"], and there's no compatible match between those two lists.

Here's my Gemfile and there is no Gemfile.lock in the directory.

[root@ip-172-30-4-16 rails]# gem -v
2.6.11
[root@ip-172-30-4-16 rails]# ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
[root@ip-172-30-4-16 rails]# bundle -v
Bundler version 1.14.6

[root@ip-172-30-4-16 rails]# cat Gemfile
source 'http://rubygems.org'

gem 'echoe'
gem 'rails', '~> 3.2.11'
gem 'mysql2'
gem 'prawn', '~> 0.5.0.1'
gem 'prawn-core', '~> 0.5.0.1', :require => 'prawn/core'
gem 'prawn-layout', '~> 0.2.0.1', :require => 'prawn/layout'
gem 'prawn-format', '~> 0.2.0.1', :require => 'prawn/format'
gem 'spreadsheet', '~> 0.6.5'
gem 'libxml-ruby', :require => 'libxml_ruby'
gem 'faker'
gem 'json'
gem 'rake'
gem 'jquery-rails'
gem 'therubyracer'
gem 'delayed_job_active_record'
gem 'daemons'
gem 'memcache-client'
gem 'rb-readline'
gem 'rubyzip', '~> 1.0.0'
gem 'zip-zip' # Rubyzip old API compatibility addon

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

#group :development do
#  gem 'ruby-debug19'
#end

group :test do
  gem 'flexmock', '= 0.9.0'
  gem 'machinist', '= 2.0'
  gem 'test-unit', '~> 1.2.3'
  # Use SimpleCov and Coveralls for test coverage reports
  gem 'simplecov'
  gem 'coveralls'
end

group :production do
  gem 'passenger'
end

group :test, :development do
  gem 'rspec-rails', '~> 2.0'
end
AnthonyC
  • 1,880
  • 2
  • 20
  • 27
  • Can you run `bundle platform`? – Igor Pavlov Mar 23 '17 at 07:14
  • [root@ip-172-30-4-16 rails]# bundle platform Your platform is: x86_64-linux Your app has gems that work on these platforms: Your Gemfile does not specify a Ruby version requirement. [root@ip-172-30-4-16 rails]# bundle platform --ruby No ruby version specified – AnthonyC Mar 23 '17 at 13:16
  • this answer worked for me (and many others apparently...) https://stackoverflow.com/a/44350326/2279644 – SilverTech Feb 21 '23 at 10:51

3 Answers3

11

I had the same issue, I had to remove the .bundle directory and then bundle install worked.

LightningStryk
  • 920
  • 8
  • 11
7

I was able to work around issue /w bundle install --no-deployment option

AnthonyC
  • 1,880
  • 2
  • 20
  • 27
  • Please exclude "option" from the command code highlighting. It creates some confusion that this is a part of the command. – Vladimir S. Jun 28 '17 at 09:28
4

If you get this error when using GitHub Actions, you can fix it by adding the Ruby platform to your Gemfile.lock:

$ bundle lock --add-platform ruby

Then commit, and push your change.