This Question is Answered

2 "helpful" answers available (2 pts)
6 Replies Last post: Jun 10, 2011 5:02 AM by Christian Nelson  
Christian Nelson Newbie 22 posts since
Dec 1, 2006
Currently Being Moderated

May 27, 2011 4:57 AM

Ruby environment configurator woes

As far as I can tell, the RVM ruby environment configurator is completely broken. Here's how I have it configured:

 

tc-steps-and-features.png

RVM is installed and that ruby + gemset combination exists. Here's what happens when I trigger a build:

 

tc-build-log.png

 

As you can see, it's using the system ruby (see Evergreen_Example_Continuous_Integration_17.log for the whole thing).

 

Note that the system ruby is my rvm default (rvm use system --default). When I switch the rvm defaul to ruby-1.9.2 and restart teamcity, ruby -v returns 1.9.2.

 

What exactly does the the RVM ruby environment configurator do if it's not doing what I would expect here?

 

Thanks,

Christian

Roman.Chernyatchik  JetBrains 1,452 posts since
Sep 18, 2007
Currently Being Moderated
May 31, 2011 3:44 PM in response to: Christian Nelson
Re: Ruby environment configurator woes

Hello Chrisitian,

 

Sorry for a long time to reply. Indeed it is a regression and Ruby env build feature was broken between 6.0.3 and 6.5 releases. Due to bug the feature doesn't set necessary ENV variables for cmdline runner. I've already fixed the regression, fix will be available in 6.5 bug fix update. As your original bug (http://youtrack.jetbrains.net/issue/TW-14803) I couldn't reproduce it in early 6.0.x releases and I'm trying to reproduce it again.

 

"rvm-shell" is good point, but it doesn't cover all cases. E.g. in "cucmber" gem project .rvmrc file doesn't specify ruby interpreter, only gemset:

# .rvmrc
rvm @cucumber --create

 

Probably 3rd option in build feature may use .rvmrc file and launch process using rvm-shell. What do you think?

Roman.Chernyatchik  JetBrains 1,452 posts since
Sep 18, 2007
Currently Being Moderated
May 31, 2011 10:51 PM in response to: Christian Nelson
Re: Ruby environment configurator woes

Christian,

 

Any idea when 6.5.1 will be available?

Bug fix update will be available in a couple of weeks

I would both the command line and rake runners to completely honor the rvm settings without the need to use rvm-shell (see http://youtrack.jetbrains.net/issue/TW-14803).

 

I'm going to play with it a bit, in case of success I will inform you

Roman.Chernyatchik  JetBrains 1,452 posts since
Sep 18, 2007
Currently Being Moderated
Jun 6, 2011 5:48 PM in response to: Roman.Chernyatchik
Re: Ruby environment configurator woes

Hi Christian,

 

I've played a bit with .rvmrc support. I don't want to redirect all execution to rvm-shell because people use rake runner not only for Ruby projects, also for some .NET projects. So such people may want to pass rvm environment not only to CommandLine and Rake build runners, but also to some other runners type. So general solution is to fetch all environment variables using rvm-shell script and then pass it to all build steps. As far as I understand such rvm-shell emulation has the same behaviour as commands redirecting to rvm-shell script.

 

So Ruby env configurator build feature will provide 3 ways for specifing interpreter

1. ruby interpreter path (e.g. for Windows guys)

2. rvm sdk & gemset name (for those how don't want use .rvmrc settings, e.g. to run tests on different ruby interpreters instead of hardcoded in .rvmrc file) Here most likely I'll replace current implementation with rvm-shell environment variables way

3. .rvmrc (TC will fetch env variable using rvm-shell and will pass it to all build steps)

 

3rd way is DRY but not flexible, you miss some advantages of CI because better to run tests on different interpreters.

 

P.S: rvm-shell support will be added only in 6.5.2 or later. 6.5.1 is almost ready and it includes fix for regression in passing ruby env. build feature settings to cmdline build runner.

More Like This

  • Retrieving data ...