roxy
roxy copied to clipboard
Document minimum ruby version, and check at runtime
Commit 66d9d1189a1789324fcaefedec0cf0c1bf5775ad introduced a dependency on ruby 1.9 or later. That isn't a problem in itself, but should be documented as a requirement in the README. Right now it just says "ruby".
For bonus points, the ml command should check the ruby environment and warn if it doesn't appear to meet requirements.
The main use case is that OS X 10.8 still preinstalls ruby 1.8, and developers may not realize that they need 1.9 or later. The fix is easy: brew install ruby - and OS X 10.9 should come with ruby 2.0. This could also come up when deploying to older linux machines or machine images, in various environments.
The dev branch's README does say Ruby 1.9.3+ (as of 2013-07-25), but having ml check for the right version and warn is a good idea.
WIll this break my "workaround" where I cannot install Ruby and have to use jRuby instead?
Not entirely sure, but I believe ml.rb has a check for this..
Woops, check contains wrong version..
if RUBY_VERSION < "1.8.7"
@logger.warn <<-MSG
WARNING!!!
You are using a very old version of Ruby: #{RUBY_VERSION}
Roxy works best with Ruby 1.8.7 or greater.
Proceed with caution.
MSG
end
What version should it be?
Good question, not sure how to determine that. But the README says 1.9.3+ indeed..
1.9.3 is the min to support all features. 1.8.7 is the ruby version installed on older Mac OS. You do get a warning if you use < 1.9.3 and try to use certain features.
I don't think anything is wrong here.
When and where do you get the warning for using < 1.9.3? Because the check I refer to checks for < 1.8.7..
The code that prompts for a password does it.
Ah, right. That throws an exception of your Ruby version is not high enough to ask for user input.
But that sounds as if this issue can be closed then, right?
Actually roxy (in dev) will not work at all with 1.8.7:
+ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
[workspace] $ /bin/sh -xe /tmp/hudson5032870590511670673.sh
+ chmod 725 ml
+ ./ml dev bootstrap --ml.user=admin --ml.password=xquerrail
./deploy/lib/util.rb:84: warning: regexp has `}' without escape
./deploy/lib/server_config.rb:16:in `require': ./deploy/lib/util.rb:84: invalid regular expression; '{' can't be last character: /\{{/ (SyntaxError)
from ./deploy/lib/server_config.rb:16
from deploy/lib/ml.rb:17:in `require'
from deploy/lib/ml.rb:17
Should I change the regex according to this suggestion [1]?
[1] - http://stackoverflow.com/questions/1985812/sanitizing-user-regexp
Yeah, we should either fix that, or update the message. Reopening this issue. Sorry for the late reply..