1

こんにちは、私はきゅうりの初心者で、モンゴイドのアプリを持っています。

Gemfileに database_cleaner があります

gem "database_cleaner", ">= 0.7.2", :group => :test

私のapp/features/support/env.rbファイルには次のものがあります。

require 'cucumber/rails'
Capybara.default_selector = :css
ActionController::Base.allow_rescue = false
begin
  DatabaseCleaner.orm = 'mongoid'
  DatabaseCleaner.strategy = :truncation
rescue NameError
  raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end
Cucumber::Rails::Database.javascript_strategy = :truncation

私が走るときrake cucumber

次のエラーが表示されます。

uninitialized constant Cucumber::Rails::Database (NameError)
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing_from_s3_library'
/home/ubuntu/Desktop/mf9/features/support/env.rb:59:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/rb_support/rb_language.rb:129:in `load'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/rb_support/rb_language.rb:129:in `load_code_file'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:82:in `each'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/runtime/support_code.rb:82:in `load_files!'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/runtime.rb:175:in `load_step_definitions'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/runtime.rb:40:in `run!'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/cli/main.rb:43:in `execute!'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/lib/cucumber/cli/main.rb:20:in `execute'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/gems/cucumber-1.1.9/bin/cucumber:14:in `<top (required)>'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/bin/cucumber:23:in `load'
/home/ubuntu/.rvm/gems/ruby-1.9.3-p125@rails32/bin/cucumber:23:in `<main>'
rake aborted!
Command failed with status (1): [/home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/b...]
4

1 に答える 1

1

これと同様の問題があり、RVM が問題を引き起こしていると思います。

基本的に、Ruby がコンパイルされる依存関係です。rvm ノートの使用

sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
于 2012-07-11T18:00:23.350 に答える