“捆绑安装”错误

发布于 2024-12-16 17:37:18 字数 869 浏览 1 评论 0原文

我正在使用 Michael Hartl 的“Ruby on Rails 示例教程”(截屏视频),在第三节课(示例应用程序)中尝试“捆绑安装”时遇到了一些错误。

我按照教程中所示更改了 Gemfile,如网站(更新后的)所示,甚至尝试了本教程的最终 Gemfile。每次我收到不同的错误,表明无法安装某些内容,并且捆绑包安装无法继续。

首先它说的是“nokogiri”,然后是“json”,现在是“bcrypt”。当我制作第一个应用程序和演示应用程序时,这种情况没有发生。也许是因为现在我尝试添加了 rspec?我不想在不将其添加到 Gemfile 的情况下继续本教程,因为它听起来很重要。

我正在运行 osx lion 10.7.2,rails 版本 3.0.1。

将 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 

更新: 我从某人那里听说 rspec 是用于测试的 gem,因此您无法在没有默认测试的情况下创建 Rails 项目,然后更改 gemfile。那么,为什么在教程中他创建了一个“rails new example_app -T”,但事后更改了 Gemfile,使其使用 rspec?他说,他们互相取代。 rspec 取代了原始测试,因此您需要创建一个没有原始测试的项目。对此有何想法?

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

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. 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'. This did not happen when I did the first app and the demo app. maybe because now I tried added the rspec? I don't want to continue the tutorial without adding it to the Gemfile, because it sounds important.

I'm running osx lion 10.7.2, rails version 3.0.1.

Copying Gemfile code from comment into original post:

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. So why in the tutorial he make a "rails new sample_app -T" but afterwords changes the Gemfile so it uses 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. any thoughts on this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍景流年 2024-12-23 17:37:18

我为这个错误困扰了几个小时,然后检查了 rspec github 页面。根据他们的指示,您需要包含 github 的路径。所以我由 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

我正在使用 Ruby 1.9.3、Rails 3.2.1、RVM 1.10.2、Bundler 1.0.21

I screwed around with this error for a few hours, then checked the rspec github page. Per their instructions, you need to include the path to github. So I made by Gemfile look like following and it now works:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文