Bundler无法找到适用于宝石的兼容版本“activesupport”和“railties” [英] Bundler could not find compatible versions for gem "activesupport" and "railties"

查看:77
本文介绍了Bundler无法找到适用于宝石的兼容版本“activesupport”和“railties”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功将Railsinstaller安装在Win 8 PC上并开始了一个项目。我建立了github并将项目推向了它。在第一台个人电脑上,一切都在找工作。然后,我在第二台Win 8 PC上安装了Railsinstaller。在第二台PC上,我运行了 gem update rails 。然后我运行 git clone [url] ,那也是成功的。但是我无法启动rails服务器,因为缺少一个gem。以下是 gem list 的输出:

  actionmailer(4.0.0 ,3.2.13)
actionpack(4.0.0,4.0.0.rc2,3.2.13)
activemodel(4.0.0,3.2.13)
activerecord(4.0.0,3.2 .13)
activerecord-deprecated_finders(1.0.3)
activerecord-sqlserver-adapter(3.2.10)
activeresource(3.2.13)
activesupport(4.0.0,4.0 .0.rc2,3.2.13)
arel(4.0.0,3.0.2)
atomic(1.1.10)
bcrypt-ruby(3.1.1 x86-mingw32)
bigdecimal(1.1.0)
builder(3.1.4,3.0.4)
bundler(1.3.4)
咖啡栏(4.0.0,3.2.2)
coffee-script(2.2.0)
coffee-script-source(1.6.1)
devise(3.0.0)
diff-lcs(1.2.4)
erubis(2.7.0)
execjs(1.4.0)
加息(1.2.1)
i18n(0.6.4,0.6.1)
io-console(0.3)
journey(1.0.4)
jquery-rails(3.0.4,2.2.1)
json(1.5.5)
mail(2.5.3)
mime-types(1.21)
minitest(4.7.5,2.5.1)
multi_json(1.7.1)
orm_adapter(0.4.0)
pg(0.14.1 x86 -mingw32)
po lyglot(0.3.3)
rack(1.5.2,1.4.5)
rack-cache(1.2)
rack-ssl(1.3.3)
rack-test( 0.6.2)
rails(4.0.0,3.2.13)
railties(4.0.0,4.0.0.rc2,3.2.13)
rake(10.0.3,0.9。 2.2)
rb-readline(0.4.2)
rdoc(3.9.5)
rspec(2.14.1)
rspec-core(2.14.4)
rspec-expectations(2.14.0)
rspec-mocks(2.14.1)
rspec-rails(2.14.0)
ruby​​zip(0.9.9)
sass(3.2。 7)
sass-rails(4.0.0,3.2.6)
链轮(2.10.0,2.2.2)
sprocket-rails(2.0.0)
sqlite3( 1.3.7 x86-mingw32)
sqlite3-ruby(1.3.3)
thor(0.18.1,0.17.0)
thread_safe(0.1.0)
tilt(1.3 .6)
tiny_tds(0.5.1 x86-mingw32)
treetop(1.4.12)
tzinfo(0.3.37)
warden(1.2.3)

我尝试了 bundle install

  Bundler找不到兼容版本的gemrailties:
在Gemfile中:
rspec-rails(= 2.6.1)x86 -mingw32取决于
railties(〜> 3.0)x86-mingw32

sass-rails(〜> 4.0.0)x86-mingw32依赖于
railties(4.0.0)

包裹更新

 Bundler找不到兼容版本的gemactivesupport:
在Gemfile中:
rspec-rails(= 2.6.1)x86-mingw32依赖于
activesupport(〜> 3.0)x86-mingw32
$ b $ rails(= 4.0.0)x86-mingw32依赖于
activesupport(4.0.0)

Bundler可以没有找到适用于gemrailties的兼容版本:
在Gemfile中:
rails(= 4.0.0)x86-mingw32依赖于
railties(= 4.0.0)x86-mingw32

sass-rails(〜> 4.0.0)x86-mingw32依赖于
railties(4.0.0.rc2)

但没有帮助。我也删除了gemfile.lock并运行上面提到的命令,但仍然没有运气。我觉得奇怪的是,它抱怨gem的版本冲突,但是当我查看gem文件时,我发现所有必需的版本都已安装。请你指点我可能会做错的事情,因为我完全没有想法?谢谢。



更新:



这是我的gemfile:

  source'https://rubygems.org'

#Bundle edge Rails改为:gem'rails',github:'rails / rails'
gem'rails','4.0.0'

#使用sqlite3作为Active Record的数据库
#gem'sqlite3'

#使用样式表的SCSS
gem'sass-rails','〜> 4.0.0'

#使用Uglifier作为JavaScript资源的压缩器
gem'uglifier','> = 1.3.0'

#使用CoffeeScript for。 js.coffee资产和视图
gem'coffee-rails','〜> 4.0.0'

#请参阅https://github.com/sstephenson/execjs#readme以获得更多支持的运行时间
#gem'therubyracer',平台:: ruby​​

#将jquery用作JavaScript库
gem'jquery-rails'

#Turbolinks可以更快地在您的Web应用程序中创建以下链接。阅读更多:https://github.com/rails/turbolinks
gem'turbolinks'

#轻松构建JSON API。阅读更多:https://github.com/rails/jbuilder
gem'jbuilder','〜> 1.2'

group:doc do
#bundle exec rake doc:rails在doc / api下生成API。
gem'sdoc',要求:false
结束

#使用ActiveModel has_secure_password
#gem'bcrypt-ruby','〜> 3.0.0'

#使用独角兽作为应用服务器
#gem'unicorn'

#使用Capistrano进行部署
#gem'capistrano' ,group::development

#使用调试器
#gem'debugger',group:[:development,:test]

group:development do
gem'sqlite3'
gem'rspec-rails','2.6.1',:require => 'rspec-rails'
gem'faker','0.3.1'
end

group:test do
gem'sqlite3'
gem' rspec-rails','2.6.1',:require => 'rspec-rails'
gem'webrat','0.7.1'
gem'factory_girl_rails','1.0'
gem'turn',:require => false
end

group:production do
gem'pg'
end


解决方案

如果bundle说它无法找到兼容的gem版本,可能是因为它无处可寻。你给它的版本号,即迫使它为每个gem采用某些版本,或者高于 X 或低于 X <

尝试从您的Gemfile中删除罪魁祸首的版本号,然后再试一次:

  gem'rspec-rails'

p>

  gem'rspec-rails','2.6.1'


I successfully installed the Railsinstaller on a Win 8 PC and started a project. I set up github and pushed the project to it. On the first PC everything was working find. Then I installed the Railsinstaller on a second Win 8 PC. On the second PC, I ran gem update rails. Then I ran git clone [url] and that was also successful. But I cannot start the rails server because a gem is missing. Here is the output of gem list:

actionmailer (4.0.0, 3.2.13)
actionpack (4.0.0, 4.0.0.rc2, 3.2.13)
activemodel (4.0.0, 3.2.13)
activerecord (4.0.0, 3.2.13)
activerecord-deprecated_finders (1.0.3)
activerecord-sqlserver-adapter (3.2.10)
activeresource (3.2.13)
activesupport (4.0.0, 4.0.0.rc2, 3.2.13)
arel (4.0.0, 3.0.2)
atomic (1.1.10)
bcrypt-ruby (3.1.1 x86-mingw32)
bigdecimal (1.1.0)
builder (3.1.4, 3.0.4)
bundler (1.3.4)
coffee-rails (4.0.0, 3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.6.1)
devise (3.0.0)
diff-lcs (1.2.4)
erubis (2.7.0)
execjs (1.4.0)
hike (1.2.1)
i18n (0.6.4, 0.6.1)
io-console (0.3)
journey (1.0.4)
jquery-rails (3.0.4, 2.2.1)
json (1.5.5)
mail (2.5.3)
mime-types (1.21)
minitest (4.7.5, 2.5.1)
multi_json (1.7.1)
orm_adapter (0.4.0)
pg (0.14.1 x86-mingw32)
polyglot (0.3.3)
rack (1.5.2, 1.4.5)
rack-cache (1.2)
rack-ssl (1.3.3)
rack-test (0.6.2)
rails (4.0.0, 3.2.13)
railties (4.0.0, 4.0.0.rc2, 3.2.13)
rake (10.0.3, 0.9.2.2)
rb-readline (0.4.2)
rdoc (3.9.5)
rspec (2.14.1)
rspec-core (2.14.4)
rspec-expectations (2.14.0)
rspec-mocks (2.14.1)
rspec-rails (2.14.0)
rubyzip (0.9.9)
sass (3.2.7)
sass-rails (4.0.0, 3.2.6)
sprockets (2.10.0, 2.2.2)
sprockets-rails (2.0.0)
sqlite3 (1.3.7 x86-mingw32)
sqlite3-ruby (1.3.3)
thor (0.18.1, 0.17.0)
thread_safe (0.1.0)
tilt (1.3.6)
tiny_tds (0.5.1 x86-mingw32)
treetop (1.4.12)
tzinfo (0.3.37)
warden (1.2.3)

I tried bundle install:

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rspec-rails (= 2.6.1) x86-mingw32 depends on
      railties (~> 3.0) x86-mingw32

    sass-rails (~> 4.0.0) x86-mingw32 depends on
      railties (4.0.0)

and bundle update:

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    rspec-rails (= 2.6.1) x86-mingw32 depends on
      activesupport (~> 3.0) x86-mingw32

    rails (= 4.0.0) x86-mingw32 depends on
      activesupport (4.0.0)

Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rails (= 4.0.0) x86-mingw32 depends on
      railties (= 4.0.0) x86-mingw32

    sass-rails (~> 4.0.0) x86-mingw32 depends on
      railties (4.0.0.rc2)

but that didn't help. I also deleted gemfile.lock and ran the above mentioned commands but still no luck. What I find strange is that it complains of version conflict of gems, but when I look at the gem file I see that all the necessary versions are installed. Could you please point me to what I might be doing wrong as I am completely out of ideas? Thank you.

UPDATE:

This is my gemfile:

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'

# Use sqlite3 as the database for Active Record
#gem 'sqlite3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

group :development do
  gem 'sqlite3'
  gem 'rspec-rails', '2.6.1', :require => 'rspec-rails'
  gem 'faker', '0.3.1'
end

group :test do
    gem 'sqlite3'
    gem 'rspec-rails', '2.6.1', :require => 'rspec-rails'
    gem 'webrat', '0.7.1'
    gem 'factory_girl_rails', '1.0'
    gem 'turn', :require => false
end

group :production do
    gem 'pg'
end

解决方案

If bundle says it cannot find compatible gem versions it's probably because it has nowhere to look. You're giving it version numbers, i.e. forcing it to take certain versions for each gem, or versions superior to X, or inferior to X.

Try deleting the version numbers for the culprit gems from your Gemfile and try again:

gem 'rspec-rails'

instead of

gem 'rspec-rails', '2.6.1'

这篇关于Bundler无法找到适用于宝石的兼容版本“activesupport”和“railties”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆