Cucumber-rails on jruby installs the gem to the root of the apps using the package
Just install cucumber 0.7.2
and cucumber-rails 0.3.1
using jruby-1.4.0 on OSX. When I run the installation of the package, it puts the cucumber-rails directory in my main application with all the gem codes / dependencies.
First, this is definitely not what I want and I am not sure why this only happens for cucumber rails.
Second, if I delete that folder and just manually install cucumber rails when I run script/generate feature blah
, I get
/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
Similarly, rake cucumber
I get
rake aborted!
source index not created from disk
So something is clearly not working. If I add this cucumber-rails directory back then mine will execute rake cucumber
.
Can someone tell me why I need to install the gem right in my rails app? I've never seen this before.
Configuring
JRuby-1.4.0
cucumber-0.7.2
cucumber rails 0.3.1
bundler 0.9.23
webrat 0.7.1
EDIT
To add to this, I decided I was tired of trying to get this to work, so I removed all cucumber / cucumber-rails from my Gemfile and reran bundle install
. It still creates the cucumber-rails directory and furthermore, I cannot start anything unless that directory is present (rake, etc.), otherwise I get a message source index not created from disk
.
EDIT2
I just noticed mine Rails.root/.bundle/config
has BUNDLE_PATH: cucumber-rails
. Does anyone have any idea why it would be there?
a source to share
It has to do with how you install stuff with bundler.
you probably did something like:
bundle set cucumber-rails
If you run this package, it is assumed that you want to sell your package in this directory within your project.
your .bundle / config should probably just contain:
BUNDLE_DISABLE_SHARED_GEMS: "1"
By deleting this folder, you are effectively removing your package.
Just change this as above and run:
install the package.
a source to share
I was able to get an app from scratch working with the following gems:
$ jruby -S gem list
*** LOCAL GEMS ***
actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activerecord-jdbc-adapter (0.9.6)
activeresource (2.3.5)
activesupport (2.3.5)
builder (2.1.2)
bundler (0.9.25)
cucumber (0.7.2)
cucumber-rails (0.3.1)
database_cleaner (0.5.2)
diff-lcs (1.1.2)
gherkin (1.0.24)
jdbc-sqlite3 (3.6.3.054)
jruby-openssl (0.7)
json_pure (1.4.3)
nokogiri (1.4.1)
rack (1.0.1)
rack-test (0.5.3)
rails (2.3.5)
rake (0.8.7)
term-ansicolor (1.0.5)
trollop (1.16.2)
webrat (0.7.1)
I had to upgrade to Bundler 0.9.25 and I followed the instructions for using Bundler with Rails 2:
http://gembundler.com/rails23.html
This is what my Gemfile looked like:
source :gemcutter
gem "rails", "~> 2.3.5"
gem 'activerecord-jdbc-adapter', :require => false
gem 'jdbc-sqlite3', :require => false
group :development do
end
group :test do
gem 'cucumber-rails'
gem 'webrat'
gem 'database_cleaner'
end
a source to share