Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 在Jenkins CI中找不到json-1.6.5_Ruby_Ruby On Rails 3_Rake_Sinatra_Jenkins - Fatal编程技术网

Ruby 在Jenkins CI中找不到json-1.6.5

Ruby 在Jenkins CI中找不到json-1.6.5,ruby,ruby-on-rails-3,rake,sinatra,jenkins,Ruby,Ruby On Rails 3,Rake,Sinatra,Jenkins,我有一个Jenkins CI服务器,当我运行以下构建脚本时,会出现错误: rdoc spec 以下是错误: /usr/bin/ruby1.9.1 -S rspec spec/requests/home_spec.rb /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find json-1.6.5 in an

我有一个Jenkins CI服务器,当我运行以下构建脚本时,会出现错误:

rdoc spec
以下是错误:

/usr/bin/ruby1.9.1 -S rspec spec/requests/home_spec.rb
/home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/spec_set.rb:88:in `block in materialize': Could not find json-1.6.5 in any of the sources (Bundler::GemNotFound)
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `map!'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/spec_set.rb:82:in `materialize'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/definition.rb:90:in `specs'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/definition.rb:135:in `specs_for'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler/runtime.rb:11:in `setup'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler.rb:117:in `setup'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
    from /var/lib/jenkins/jobs/App1/workspace/config/boot.rb:10:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /var/lib/jenkins/jobs/App1/workspace/spec/spec_helper.rb:11:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /var/lib/jenkins/jobs/App1/workspace/spec/requests/home_spec.rb:1:in `<top (required)>'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `block in load_spec_files'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `map'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/configuration.rb:698:in `load_spec_files'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/command_line.rb:22:in `run'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:80:in `run_in_process'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:69:in `run'
    from /home/zeck/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.8.0/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!
这是我的档案:

source :rubygems

# Required gems
gem 'sinatra', '>= 1.3.2'
gem 'rdoc', '>= 3.12'
gem 'rake'
gem 'json', '>= 1.6.5'

group :test do
  gem 'rspec', '>= 2.9.0'
  gem 'rack-test'
  gem 'simplecov', '>= 0.6.1', require: false
end
我不知道。请帮帮我。我在RVM中使用Ruby 1.9.3


谢谢你的建议。抱歉英语不好:)

可能是因为Jenkins运行构建的环境与运行构建的环境不同

通常,差异是由为您而不是为Jenkins设置的环境变量引起的

您可以通过运行命令
env
来检查环境变量。您可以在Manage Jenkins->System Information查看Jenkins的环境

如果需要设置一些环境变量,可以在managejenkins->configuresystem中进行设置

source :rubygems

# Required gems
gem 'sinatra', '>= 1.3.2'
gem 'rdoc', '>= 3.12'
gem 'rake'
gem 'json', '>= 1.6.5'

group :test do
  gem 'rspec', '>= 2.9.0'
  gem 'rack-test'
  gem 'simplecov', '>= 0.6.1', require: false
end