列出3.9的Michael Hartl rails教程不加载

时间:2012-11-20 08:36:36

标签: ruby-on-rails railstutorial.org

我的问题/问题

我无法在列表3.9中运行非常基本的rspec测试我觉得我遗漏了一些非常基本的东西,导致static_pages_spec返回LoadError。有谁知道出了什么问题?

错误

  

E:\ CSProj \ RailsTutorial \ sample_app> bundle exec rspec spec / request / static_pages_s   pec.rb   C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec   /core/configuration.rb:780:in load': cannot load such file -- E:/CSProj/RailsTu torial/sample_app/spec/request/static_pages_spec.rb (LoadError) from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:in块中的load_spec_files'          来自C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1   1.1 / lib / rspec / core / configuration.rb:780:在map' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/configuration.rb:780:in load_spec_files'中          来自C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1   1.1 / lib / rspec / core / command_line.rb:22:in run' from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1 1.1/lib/rspec/core/runner.rb:69:in run'          来自C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rspec-core-2.1   1.1 / lib / rspec / core / runner.rb:8:在`block in autorun'

代码

我使用以下代码:https://github.com/adoliver/sample_app/blob/static-pages/spec/requests/static_pages_spec.rb

require 'spec_helper'

describe "Static pages" do

  describe "Home page" do

    it "should have the content 'Sample App'" do
      visit '/static_pages/home'
      page.should have_content('Sample App')
    end
  end
end

有关我的开发环境的一些信息

Windows 7 使用railsInstaller 使用Windows native命令行 本教程中的先前步骤有效。

E:\ CSProj \ RailsTutorial \ sample_app> ruby​​ -v ruby 1.9.3p125(2012-02-16)[i386-mingw32]

E:\ CSProj \ RailsTutorial \ sample_app> rails -v Rails 3.2.9

我的捆绑包:

E:\ CSProj \ RailsTutorial \ sample_app>捆绑列表 捆绑包含的宝石:

  • actionmailer(3.2.9)
  • actionpack(3.2.9)
  • activemodel(3.2.9)
  • activerecord(3.2.9)
  • activeresource(3.2.9)
  • activesupport(3.2.9)
  • arel(3.0.2)
  • builder(3.0.4)
  • bundler(1.0.22)
  • capybara(1.1.2)
  • childprocess(0.3.6)
  • coffee-rails(3.2.2)
  • coffee-script(2.2.0)
  • coffee-script-source(1.4.0)
  • diff-lcs(1.1.3)
  • erubis(2.7.0)
  • execjs(1.4.0)
  • ffi(1.2.0)
  • hike(1.2.1)
  • i18n(0.6.1)
  • 旅程(1.0.4)
  • jquery-rails(2.0.2)
  • json(1.7.5)
  • libwebsocket(0.1.6.1)
  • mail(2.4.4)
  • mime-types(1.19)
  • multi_json(1.3.7)
  • nokogiri(1.5.5)
  • 多语言(0.3.3)
  • rack(1.4.1)
  • rack-cache(1.2)
  • rack-ssl(1.3.2)
  • rack-test(0.6.2)
  • rails(3.2.9)
  • railties(3.2.9)
  • rake(10.0.2)
  • rdoc(3.12)
  • rspec(2.11.0)
  • rspec-core(2.11.1)
  • rspec-expectations(2.11.3)
  • rspec-mocks(2.11.3)
  • rspec-rails(2.11.0)
  • ruby​​zip(0.9.9)
  • sass(3.2.3)
  • sass-rails(3.2.5)
  • selenium-webdriver(2.26.0)
  • 链轮(2.2.1)
  • sqlite3(1.3.5)
  • thor(0.16.0)
  • 倾斜(1.3.3)
  • treetop(1.4.12)
  • tzinfo(0.3.35)
  • uglifier(1.2.3)
  • websocket(1.0.3)
  • xpath(0.1.4)

1 个答案:

答案 0 :(得分:0)

您报告:

load': cannot load such file -- E:/CSProj/RailsTu torial/sample_app/spec/request/static_pages_spec.rb (LoadError)

我不知道这是否愚蠢,但我的目录树中的规格位于/app/spec/requests,而不是app/spec/request