简体   繁体   English

“捆绑安装”错误

[英]“bundle install” error

I'm using the "ruby on rails by example tutorial" (screencasts) by Michael Hartl and I'm getting some errors during the third lesson (sample app) while trying to do "bundle install". 我正在使用Michael Hartl的“示例教程中的红宝石”(截屏视频),并且在尝试“捆绑安装”的第三堂课(示例应用程序)中遇到一些错误。

I changed the Gemfile as shown in the tutorial, as shown in the website(the updated one), and even tried the final Gemfile for this tutorial. 我按照本教程中的说明更改了Gemfile,如网站(已更新的网站)所示,甚至尝试了本教程的最终Gemfile。 Every time I get a different error that something couldn't been install, and the bundle installation could not continue. 每次遇到另一个错误,即无法安装某些东西,并且捆绑软件安装无法继续进行。

At first it said it about 'nokogiri', then 'json', and now 'bcrypt'. 最初,它说的是“ nokogiri”,然后是“ json”,现在是“ bcrypt”。 This did not happen when I did the first app and the demo app. 当我创建第一个应用程序和演示应用程序时,这没有发生。 maybe because now I tried added the rspec? 也许是因为现在我尝试添加了rspec? I don't want to continue the tutorial without adding it to the Gemfile, because it sounds important. 我不想在不将其添加到Gemfile中的情况下继续本教程,因为这听起来很重要。

I'm running osx lion 10.7.2, rails version 3.0.1. 我正在运行osx lion 10.7.2,rails版本3.0.1。

Copying Gemfile code from comment into original post: 将Gemfile代码从注释复制到原始帖子中:

source 'rubygems.org'; 

gem 'rails', '3.0.1' 
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' 

group :development do 
     gem 'rspec-rails', '2.0.0.beta.18' 
end 

group :test do 
     gem 'rspec', '2.0.0.beta.18' 
end 

update: I heard from someone that rspec is a gem used on tests, therefore you can't make a rails project without the default test and then change the gemfile. 更新:我听说有人说rspec是测试中使用的gem,因此如果没有默认测试,就无法创建Rails项目,然后更改gemfile。 So why in the tutorial he make a "rails new sample_app -T" but afterwords changes the Gemfile so it uses rspec? 那么,为什么在本教程中他制作了“ rails new sample_app -T”,但是后记改变了Gemfile以便它使用rspec? he says, that they replace each other. 他说,他们彼此替换。 that rspec replace the original test, and therefore you need to make a project without the original test. 该rspec替换了原始测试,因此您需要创建一个没有原始测试的项目。 any thoughts on this? 有什么想法吗?

I screwed around with this error for a few hours, then checked the rspec github page. 我花了几个小时解决了这个错误,然后检查了rspec github页面。 Per their instructions, you need to include the path to github. 按照他们的指示,您需要包括github的路径。 So I made by Gemfile look like following and it now works: 因此,我由Gemfile制作的内容如下所示,现在可以使用:

group :development do
  gem "rspec-rails",        :git => "git://github.com/rspec/rspec-rails.git"
  gem "rspec",              :git => "git://github.com/rspec/rspec.git"
  gem "rspec-core",         :git => "git://github.com/rspec/rspec-core.git"
  gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
  gem "rspec-mocks",        :git => "git://github.com/rspec/rspec-mocks.git"
end

group :test do
  gem "rspec-rails",        :git => "git://github.com/rspec/rspec-rails.git"
  gem "rspec",              :git => "git://github.com/rspec/rspec.git"
  gem "rspec-core",         :git => "git://github.com/rspec/rspec-core.git"
  gem "rspec-expectations", :git => "git://github.com/rspec/rspec-expectations.git"
  gem "rspec-mocks",        :git => "git://github.com/rspec/rspec-mocks.git"
  gem 'webrat'
end

I am using Ruby 1.9.3, Rails 3.2.1, RVM 1.10.2, Bundler 1.0.21 我正在使用Ruby 1.9.3,Rails 3.2.1,RVM 1.10.2,Bundler 1.0.21

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM