Why can't my Rails app find the gems that are packed with it?

I have a Rails application using Cucumber and RSpec. We store gems under the crown / gems and try to get the creation of the application (running tests) on the CI server.

When I try to run our tests, I get the following error:

Missing these required gems:
  cucumber  >= 0.3.11
  rspec-rails  >= 1.2.6

When I run RAILS_ENV=test rake gems, I get the following:

 - [F] activerecord-oracle-adapter
    - [R] activerecord >= 1.15.5.7843
 - [F] thoughtbot-factory_girl = 1.2.0
 - [F] cucumber >= 0.3.11
    - [ ] term-ansicolor >= 1.0.3
    - [ ] treetop >= 1.2.6
    - [ ] diff-lcs >= 1.1.2
    - [I] builder >= 2.1.2
 - [F] webrat >= 0.4.4
    - [I] nokogiri >= 1.2.0
 - [F] rspec >= 1.2.6
 - [F] rspec-rails >= 1.2.6
    - [F] rspec >= 1.2.7
    - [ ] rack >= 0.4.0
 - [F] thoughtbot-shoulda >= 2.10.2

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

Does empty empty [] mean that the gem is missing?

config / environment / test.rb contains the following:

config.gem "cucumber",           :lib => false,          :version => ">=0.3.11" unless File.direct
ory?(File.join(Rails.root, 'vendor/plugins/cucumber'))
config.gem "webrat",             :lib => false,          :version => ">=0.4.4"  unless File.direct
ory?(File.join(Rails.root, 'vendor/plugins/webrat'))
config.gem "rspec",              :lib => false,          :version => ">=1.2.6"  unless File.direct
ory?(File.join(Rails.root, 'vendor/plugins/rspec'))
config.gem "rspec-rails",        :lib => "spec/rails",   :version => ">=1.2.6"  unless File.direct
ory?(File.join(Rails.root, 'vendor/plugins/rspec-rails'))
config.gem "thoughtbot-shoulda", :lib => false,          :version => ">=2.10.2" unless File.direct
ory?(File.join(Rails.root, 'vendor/plugins/shoulda'))

So everything looks fine, but it still doesn't work.

Am I missing something obvious?

+3
source share
1 answer

, cucumber, rspec rspec-rails () vendor/gems, cucumber rspec-rails. , [] , .

:

rm -rf vendor/gems/cucumber
rm -rf vendor/gems/rspec-rails
rm -rf vendor/gems/rspec

:

gem install rspec rspec-rails cucumber

.

, vendor/gems, :

RAILS_ENV=test rake gems:unpack:dependencies GEM=rspec-rails
RAILS_ENV=test rake gems:unpack:dependencies GEM=cucumber

, :

RAILS_ENV=test rake gems:unpack:dependencies

vendor/gems. nokogiri , , .

+4

Source: https://habr.com/ru/post/1724561/


All Articles