开发者

Simple Ruby Command Line Question

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜