开发者

Simple Ruby Command Line Question

开发者 https://www.devze.com 2022-12-22 19:47 出处:网络
Um - I feel like an idiot, but.... ruby -e \'3+5\' Outputs nothing (Windows 7, Ruby 1.8.7, Cygwin or Git Bash). What am I missing? Extra credit - will this also allow the extra cool bundle (stolen

Um - I feel like an idiot, but....

ruby -e '3+5'

Outputs nothing (Windows 7, Ruby 1.8.7, Cygwin or Git Bash). What am I missing? Extra credit - will this also allow the extra cool bundle (stolen from TextMate) Execute and Update # => markers to work properly?

EDIT

Ok that worked, and I'll accept the answer, but e-tex开发者_JAVA技巧teditor still doesn't work with that really cool bundle. Too bad.


try:

ruby -e 'puts 3+5'


You're missing a call to puts or any other method that produces output. ruby -e doesn't print the return value of the expression - it just executes it. It acts exactly as if you were executing a rb file containing "3+5".

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号