我試圖使用Circleci持續集成和運行成爲一個問題。我正在部署使用ruby 2.2.2和rspec的rails 4應用程序。circleci持續集成Rails應用程序錯誤需要條紋
當我試圖通過circleci把我的第一次構建,我得到一個錯誤,當它試圖運行我的代碼行測試套件在我的「spec_helper」我在哪裏需要帶寶石。我用條紋在該應用中,用「條紋模擬」
測試它下面的錯誤是。所以失敗是我在spec_helper中的require "stripe"
行。要清楚rspec運行並通過本地,但我在circleci上得到這個錯誤。我加倍檢查,並設置了circleci上的所有環境變量。我聽說有時候寶石需要在circleci上設置的二進制文件才能工作。這可能是問題嗎?我將如何做到這一點?
rspec
/home/ubuntu/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- stripe (LoadError)
from /home/ubuntu/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ubuntu/propel/spec/spec_helper.rb:20:in `block in <top (required)>'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core.rb:97:in `configure'
from /home/ubuntu/propel/spec/spec_helper.rb:18:in `<top (required)>'
from /home/ubuntu/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ubuntu/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `block in requires='
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `each'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration.rb:1295:in `requires='
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:109:in `block in process_options_into'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:108:in `each'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:108:in `process_options_into'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/configuration_options.rb:21:in `configure'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:101:in `setup'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:88:in `run'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:73:in `run'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/lib/rspec/core/runner.rb:41:in `invoke'
from /home/ubuntu/.rvm/gems/[email protected]/gems/rspec-core-3.4.1/exe/rspec:4:in `<top (required)>'
from /home/ubuntu/.rvm/gems/[email protected]/bin/rspec:23:in `load'
from /home/ubuntu/.rvm/gems/[email protected]/bin/rspec:23:in `<main>' rspec returned exit code 1
我也應該注意到,我有帶我的Gemfile,你可以在這裏看到:
gem 'stripe'
而且你能看到我在rspec的spec_helper要求條紋在這裏:
RSpec.configure do |config|
require 'stripe'
require 'stripe_mock'
require 'thin'
儘管在我的gemfile中有條紋,但我決定嘗試將sudo gem install stripe
添加到我的circle.yml
文件中,以確保它包含在測試中,但出現以下錯誤:
sudo gem install stripe
ERROR: Error installing stripe:
sudo gem install stripe returned exit code 1
mime-types requires Ruby version >= 1.9.2. Action failed: sudo gem install stripe
當我指定我circle.yml文件紅寶石版本2.2.2
你有一個的Gemfile?它是條紋寶石嗎?最好能夠證明這一點。也最好顯示spec_helper的相關位。 –
哎@DaveSchweisguth - 我的gemfile裏有條紋寶石。我已經使用該信息和相關的spec_helper代碼更新了我的答案。 –