Cannot find home path for RVM SDK

Using a command-line step that looks like this...
#!/bin/bash
source /etc/profile.d/rvm.sh
source .rvmrc
jruby --1.9 -S bundle install

I am getting this error...
Cannot find home path for RVM SDK with name Using /usr/local/rvm/gems/jruby-1.7.8 with gemset global jruby-1.7.8

I can run these same commands in the checkout directory without an error so I cannot understand what is causing this problem other than thinking it must be something with how the agent runs the script differently than it runs under a login shell.

6 comments
Comment actions Permalink

You can try to log in as an agent user and try to do the same thing. In addition, adding printenv before calling jruby may help to understand the difference.

0
Comment actions Permalink

I noted in my original post that I am able to run the steps as the agent user from the agent's checkout directory. I tried inserting a step that just runs printenv, which gem, gem env and that fails with the same error. So, it seems to be something about the initialization of the build steps is triggering a check of the REC which is failing in this case.

0
Comment actions Permalink

Command-line runner has nothing special in initialization. It just works like a command line.

I suggested to add printenv to understand what particular environment variables are different, when you run from console and on agent's execution, as this is the case in 95% situation.

0
Comment actions Permalink

So, I created a stripped down run configuration with a single command-line build step
#!/bin/bash
source /etc/profile.d/rvm.sh
printenv
which gem
which npm

This works if there is no REC
It also works if there is an REC that specifies the RVM interpreter name
It also works if I use a .ruby-version in the project (which only contains jruby-1.7.8@global)
It does not work if the REC uses the .rvmrc that is part of our project (which only contains rvm use jruby-1.7.8@global)

0
Comment actions Permalink

Hi Andy,

I'll ask bunch of questions:
What version of TC do you use?
Where RVM installed? What version if rvm do you have? Do you use system-wide installation? Does that matches with env.evm_path agent parameter?

Could you please show diff 'printenv' output before and after 'source /etc/profile.d/rvm.sh'


REC in .rvmrc mode uses 'rvm-shell' first to detect environment, and then that env passed to all steps.
Maybe there something with rvm .rvmrc trusting.

0
Comment actions Permalink

This was fixed by using the ~/.rvmrc flag rvm_project_rvmrc=0
Looks like the .rvmrc project confirmation was creating the problem, which explains why .ruby-version fixed it.

0

Please sign in to leave a comment.