RVM/Rake Build Step Failing

I'm running rvm on my build servers, and am seeing the following error when a rake ci:lint build step is run. When I run the command 'rvm 1.9.3 do rake ci:lint' from the command line, in the working directory referenced by the build log, the command succeeds. I've also been able to run 'rvm 1.9.3 do bundle install' and 'rvm 1.9.3 do bundle exec' from within the working directory.

[12:22:38]Checking for changes
[12:22:39]Publishing internal artifacts
[12:22:39][Publishing internal artifacts] Sending using ArtifactsCachePublisher
[12:22:39][Publishing internal artifacts] Sending using WebPublisher
[12:22:39]Clearing temporary directory: /opt/TeamCity/temp/buildTmp
[12:22:39]Checkout directory: /opt/TeamCity/work/ff5f7c948cee2f59
[12:22:39]Updating sources: server side checkout (22s)
[12:22:39][Updating sources] Using vcs information from server. Reason: no revision information for buildtype Puppet and checkout directory /opt/TeamCity/work/ff5f7c948cee2f59 on agent
[12:22:39][Updating sources] Will perform clean checkout
[12:22:39][Updating sources] Clean checkout reasons
[12:22:39][Clean checkout reasons] Agent doesn't have any version of the project sources
[12:22:39][Clean checkout reasons] Checkout directory is empty or doesn't exist
[12:22:39][Updating sources] Building and caching clean patch for VCS root: stash_puppet_main
[12:22:47][Updating sources] Transferring cached clean patch for VCS root: stash_puppet_main
[12:22:59][Updating sources] Repository sources transferred: 305.29 MB total
[12:23:00][Updating sources] Average transfer speed: 22.94 MB per second
[12:23:00][Updating sources] Removing /opt/TeamCity/work/ff5f7c948cee2f59
[12:23:00][Updating sources] Updating /opt/TeamCity/work/ff5f7c948cee2f59
[12:23:01]Step 1/5: puppet-lint (Rake) (27s)
[12:23:27][Step 1/5] Environment variable 'GEM_HOME' has predefined value '/usr/local/rvm/gems/ruby-1.9.3-p551'. It may affect runtime build behaviour because TeamCity RVM support won't override it.
[12:23:27][Step 1/5] Environment variable 'GEM_PATH' has predefined value '/usr/local/rvm/gems/ruby-1.9.3-p551:/usr/local/rvm/gems/ruby-1.9.3-p551@global'. It may affect runtime build behaviour because TeamCity RVM support won't override it.
[12:23:27][Step 1/5] Environment variable 'MY_RUBY_HOME' has predefined value '/usr/local/rvm/rubies/ruby-1.9.3-p551'. It may affect runtime build behaviour because TeamCity RVM support won't override it.
[12:23:27][Step 1/5] Environment variable 'IRBRC' has predefined value '/usr/local/rvm/rubies/ruby-1.9.3-p551/.irbrc'. It may affect runtime build behaviour because TeamCity RVM support won't override it.
[12:23:28][Step 1/5] Starting: /bin/sh /opt/TeamCity/temp/agentTmp/build7515954718347920108.sh
[12:23:28][Step 1/5] in directory: /opt/TeamCity/work/ff5f7c948cee2f59
[12:23:28][Step 1/5] /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/spec_set.rb:85:in `map!'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/spec_set.rb:85:in `materialize'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/definition.rb:132:in `specs'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/definition.rb:177:in `specs_for'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/definition.rb:166:in `requested_specs'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/environment.rb:18:in `requested_specs'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/runtime.rb:13:in `setup'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler.rb:122:in `setup'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/gems/1.9.1/gems/bundler-1.7.11/lib/bundler/setup.rb:17:in `<top (required)>'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
[12:23:28][Step 1/5] from /usr/local/rvm/rubies/ruby-1.9.3-p551/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
[12:23:28][Step 1/5] Process exited with code 1
[12:23:28][Step 1/5] Step puppet-lint (Rake) failed
[12:23:28]Step 2/5: puppet-validate (Rake)
[12:23:28][Step 2/5] Build step puppet-validate (Rake) is skipped because the previous step has failed
[12:23:28]Step 3/5: puppet-validate-erb (Rake)
[12:23:28][Step 3/5] Build step puppet-validate-erb (Rake) is skipped because the previous step has failed
[12:23:28]Step 4/5: puppet-validate-hiera-json (Rake)
[12:23:28][Step 4/5] Build step puppet-validate-hiera-json (Rake) is skipped because the previous step has failed
[12:23:28]Step 5/5: puppet-validate-hiera-yaml (Rake)
[12:23:28][Step 5/5] Build step puppet-validate-hiera-yaml (Rake) is skipped because the previous step has failed
[12:23:28]Publishing internal artifacts
[12:23:28][Publishing internal artifacts] Sending using ArtifactsCachePublisher
[12:23:28][Publishing internal artifacts] Sending using WebPublisher
[12:23:28]Build finished
3 comments
Comment actions Permalink

I should add, the build step that's failing is attempting to execute ci:lint as the rake task, using the ruby-1.9.3 RVM interpreter.

0
Comment actions Permalink

Hi Scott,

Sorry for delay.

> When I run the command 'rvm 1.9.3 do rake ci:lint' from the command line, in the working directory referenced by the build log, the command succeeds.
Do you run the command under the same user that the agent is running? Please follow the steps described in the Troubleshooting doc section.

0
Comment actions Permalink

Yes, I am running the command as the user the build agent runs as. I read through your link, and I hadn't considered simply modifying the build steps to be command line instead of rake steps. After switching over to command line, the build succeeds.

0

Please sign in to leave a comment.