刚刚在 OSX 上安装cucumber 0.7.2
并cucumber-rails 0.3.1
使用 jruby-1.4.0。当我运行捆绑安装时,它会在我的主应用程序中放置一个 cucumber-rails 目录,其中包含所有 gem 代码/依赖项。
首先,这绝对不是我想要的,我不确定为什么这只发生在黄瓜导轨上。
其次,如果我删除这个文件夹并手动安装 cucumber-rails,当我运行时script/generate feature blah
我得到
/Users/bradrobertson/.rvm/rubies/jruby-1.4.0/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:344:in `refresh!': source index not created from disk (RuntimeError)
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:34:in `refresh!'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/vendor_gem_source_index.rb:29:in `initialize'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21:in `new'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/rails/gem_dependency.rb:21:in `add_frozen_gem_path'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/initializer.rb:298:in `add_gem_load_paths'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/initializer.rb:132:in `process'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/initializer.rb:113:in `run'
from /Users/bradrobertson/Repos/app/source/trunk/config/environment.rb:13
from /Users/bradrobertson/Repos/app/source/trunk/config/environment.rb:1:in `require'
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/commands/generate.rb:1
from /Users/bradrobertson/.rvm/gems/jruby-1.4.0/gems/rails-2.3.5/lib/commands/generate.rb:3:in `require'
from script/generate:3
同样运行rake cucumber
我得到
rake aborted!
source index not created from disk
所以显然有些事情是行不通的。如果我重新添加那个 cucumber-rails 目录,那么我的rake cucumber
实际运行。
有人能告诉我为什么需要在我的 Rails 应用程序中安装 gem 吗?我以前从未见过这种情况。
设置
jruby-1.4.0
cucumber-0.7.2
cucumber-rails 0.3.1
bundler 0.9.23
webrat 0.7.1
编辑
除此之外,我决定我厌倦了试图让它工作,所以我从我的 Gemfile 中删除了所有 cucumber / cucumber-rails deps 并重新运行bundle install
。它仍然会创建 cucumber-rails 目录,此外,除非该目录存在,否则我无法运行任何东西,(rake 等......)否则我会收到source index not created from disk
消息。
EDIT2
我刚刚注意到我Rails.root/.bundle/config
的BUNDLE_PATH: cucumber-rails
. 有谁知道为什么会在那里?