Padrino与RSpec:“bundler:命令未找到:rspec”

时间:2011-08-01 19:41:25

标签: rspec bundler padrino

使用Padrino,我用Shoulda创建了一个项目作为测试框架。然后我退回并删除了Shoulda并添加了RSpec。但是,在添加spec/spec.rakespec/spec_helper.rb后,我无法运行测试。

$ padrino rake spec
=> Executing Rake spec ...
/home/ethan/.rvm/rubies/ruby-1.9.2-head/bin/ruby -S bundle exec rspec -fs --color ./spec/models/user_spec.rb
bundler: command not found: rspec
Install missing gem binaries with `bundle install`
rake aborted!
ruby -S bundle exec rspec -fs --color ./spec/models/user_spec.rb failed

Tasks: TOP => spec => spec:models
(See full trace by running task with --trace)

Gemfile

source :rubygems

# Server requirements
# gem 'thin' or mongrel
gem 'thin'

# Project requirements
gem 'rake'
gem 'rack-flash'

# Component requirements
gem 'haml'
gem 'mongo_mapper'
gem 'bson_ext', :require => "mongo"
gem 'canable'
gem 'httparty'
gem 'maruku'

# Test requirements
gem 'rspec', :group => "test"
gem 'rack-test', :require => "rack/test", :group => "test"


# Padrino
gem 'padrino', '0.10.0'
# Padrino EDGE
# gem 'padrino', :git => 'git://github.com/padrino/padrino-framework.git'
#
# Individual GEMS
# gem 'padrino-core', '0.10.0'
# gem 'padrino-admin', '0.10.0'
# gem 'padrino-cache', '0.10.0'
# gem 'padrino-core', '0.10.0'
# gem 'padrino-gen', '0.10.0'
# gem 'padrino-helpers', '0.10.0'
# gem 'padrino-mailer', '0.10.0'

Gemfile.lock

GEM
  remote: http://rubygems.org/
  specs:
    activemodel (3.0.9)
      activesupport (= 3.0.9)
      builder (~> 2.1.2)
      i18n (~> 0.5.0)
    activesupport (3.0.9)
    bson (1.3.1)
    bson_ext (1.3.1)
    builder (2.1.2)
    canable (0.2.0)
    crack (0.1.8)
    daemons (1.1.4)
    diff-lcs (1.1.2)
    eventmachine (0.12.10)
    grit (2.4.1)
      diff-lcs (~> 1.1)
      mime-types (~> 1.15)
    haml (3.1.2)
    http_router (0.8.11)
      rack (>= 1.0.0)
      url_mount (~> 0.2.1)
    httparty (0.7.8)
      crack (= 0.1.8)
    i18n (0.5.0)
    mail (2.3.0)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    maruku (0.6.0)
      syntax (>= 1.0.0)
    mime-types (1.16)
    mongo (1.3.1)
      bson (>= 1.3.1)
    mongo_mapper (0.9.1)
      activemodel (~> 3.0)
      activesupport (~> 3.0)
      plucky (~> 0.3.8)
    padrino (0.10.0)
      padrino-admin (= 0.10.0)
      padrino-cache (= 0.10.0)
      padrino-core (= 0.10.0)
      padrino-gen (= 0.10.0)
      padrino-helpers (= 0.10.0)
      padrino-mailer (= 0.10.0)
    padrino-admin (0.10.0)
      padrino-core (= 0.10.0)
      padrino-helpers (= 0.10.0)
    padrino-cache (0.10.0)
      padrino-core (= 0.10.0)
    padrino-core (0.10.0)
      activesupport (~> 3.0.0)
      http_router (~> 0.8.10)
      sinatra (~> 1.2.6)
      thor (~> 0.14.3)
      tilt (~> 1.3.0)
    padrino-gen (0.10.0)
      bundler (~> 1.0.2)
      grit (~> 2.4.1)
      padrino-core (= 0.10.0)
    padrino-helpers (0.10.0)
      i18n (~> 0.5.0)
      padrino-core (= 0.10.0)
    padrino-mailer (0.10.0)
      mail (~> 2.3.0)
      padrino-core (= 0.10.0)
    plucky (0.3.8)
      mongo (~> 1.3)
    polyglot (0.3.2)
    rack (1.3.2)
    rack-flash (0.1.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rake (0.9.2)
    rspec (2.6.0)
      rspec-core (~> 2.6.0)
      rspec-expectations (~> 2.6.0)
      rspec-mocks (~> 2.6.0)
    rspec-core (2.6.4)
    rspec-expectations (2.6.0)
      diff-lcs (~> 1.1.2)
    rspec-mocks (2.6.0)
    sinatra (1.2.6)
      rack (~> 1.1)
      tilt (< 2.0, >= 1.2.2)
    syntax (1.0.0)
    thin (1.2.11)
      daemons (>= 1.0.9)
      eventmachine (>= 0.12.6)
      rack (>= 1.0.0)
    thor (0.14.6)
    tilt (1.3.2)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    url_mount (0.2.1)
      rack

PLATFORMS
  ruby

DEPENDENCIES
  bson_ext
  canable
  haml
  httparty
  maruku
  mongo_mapper
  padrino (= 0.10.0)
  rack-flash
  rack-test
  rake
  rspec
  thin

整个项目on Github

2 个答案:

答案 0 :(得分:0)

尝试

PADRINO_ENV=test rake spec

或编辑您的宝石文件删除测试组。

答案 1 :(得分:0)

我清空了gemsetrvm gemset empty),然后重新捆绑,一切顺利。奇