捆绑安装错误 - 您的捆绑包仅支持平台[],但您的本地平台是[" ruby​​"," x86_64-linux"]

时间:2017-03-23 05:26:29

标签: ruby bundler

执行捆绑安装时出现此错误; google周围似乎是一个常见问题,但我似乎无法找到修复程序(似乎是关于Gemfile.lock的建议,但我将该文件移动到另一个目录)

# 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.

这是我的Gemfile,目录中没有Gemfile.lock。

[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

3 个答案:

答案 0 :(得分:7)

我有同样的问题,我不得不删除.bundle目录,然后bundle install工作。

答案 1 :(得分:5)

我能够解决问题/ w bundle install --no-deployment选项

答案 2 :(得分:0)

如果您在使用 GitHub Actions 时遇到此错误,您可以通过将 Ruby 平台添加到您的 Gemfile.lock 来修复它:

$ bundle lock --add-platform ruby

然后提交,并推送您的更改。