我正在尝试将我的所有应用程序从 ruby 1.8.7 升级到 1.9.3。
一些应用程序运行良好。但是,我有一个 rails 3.0.x 站点,当我运行它或使用 bundle install 时,它会不断抛出有关错误捆绑器版本的错误。
Bundler could not find compatible versions for gem "bundler":
In Gemfile:
refinerycms (~> 0.9.8.5) ruby depends on
bundler (~> 1.0.0) ruby
Current Bundler version:
bundler (1.2.3)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?
我同时安装了 bundler 1.2.3(乘客需要)和 bundler 1.0.22。但是,它不会让我运行bundle install
,并且运行该站点也会引发一个错误,即 rails 3.0 需要旧版本的 bundler。
更新:我使用旧版本的捆绑器安装了我的 gem:
bundle _1.0.3_ install
就安装 gems 而言,这工作得很好,但是当我运行该站点时,Passenger 仍然抱怨我正在使用捆绑程序 1.2.3 并且它需要 (~>1.0.0)。~> 不是表示“大于 1.0”吗?我在 Ruby 1.8.7 下没有任何这些问题。
这是我的 Gemfile。如您所见,我尝试在我的 gemfile 中包含旧版本的 bundler 并排除。两种方法都行不通。:(
source 'http://rubygems.org'
#gem 'bundler', '1.0.3'
gem 'rails', '3.0.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2', '0.2.6'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug'
# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
# gem 'webrat'
# end
# REFINERY CMS ================================================================
# Specify the Refinery CMS core:
gem 'refinerycms', '~> 0.9.8.5'
# Specify additional Refinery CMS Engines here (all optional):
gem 'refinerycms-inquiries', '~> 0.9.8.10'
gem 'refinerycms-search', '~> 0.9.8'
gem "refinerycms-news", '~> 0.9.9'
# Add i18n support (optional, you can remove this if you really want to).
gem 'refinerycms-i18n', '~> 0.9.8.7'
# Figure out how to get RMagick:
rmagick_options = {:require => false}
rmagick_options.update({
:git => 'git://github.com/refinerycms/rmagick.git',
:branch => 'windows'
}) if Bundler::WINDOWS
# Specify a version of RMagick that works in your environment:
gem 'rmagick', '~> 2.12.2', rmagick_options
# END REFINERY CMS ============================================================
# USER DEFINED
# END USER DEFINED
gem 'validates_timeliness', '~> 3.0.0'
engine_path = File.join(File.dirname(__FILE__), 'vendor/engines')
#puts engine_path
gem 'refinerycms-venues', '1.0', :path => "./vendor/engines", :require => 'venues'
gem 'refinerycms-events', '1.0', :path => './vendor/engines', :require => 'events'
gem 'refinerycms-available_spaces', '1.0', :path => './vendor/engines', :require => 'available_spaces'
gem 'refinerycms-contents', '1.0', :path => 'vendor/engines', :require => 'contents'
gem 'refinerycms-news_alerts', '1.0', :path => 'vendor/engines', :require => 'news_alerts'
如果我安装了较新版本的捆绑程序,它就像 Rails 3.0 将不允许我运行该站点,但这似乎很疯狂。拥有较新版本的捆绑程序会破坏旧网站吗?