{"id":193,"date":"2011-09-28T14:26:38","date_gmt":"2011-09-28T14:26:38","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=193"},"modified":"2011-09-28T21:07:13","modified_gmt":"2011-09-28T21:07:13","slug":"installing-ruby-and-running-a-program","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2011\/09\/installing-ruby-and-running-a-program\/","title":{"rendered":"Installing Ruby and running a program"},"content":{"rendered":"<p>I&#8217;ve written my first post on a first, simple Ruby program. But I&#8217;ve not included notes there on installing and running Ruby programs. That&#8217;s because Ruby runs on a lot of different systems. And Ruby programs can be run in different ways.<\/p>\n<p>You can find advice on installing Ruby <a href=\"http:\/\/ruby.about.com\/od\/tutorials\/a\/installruby.htm\">here<\/a>.<\/p>\n<p>If you&#8217;re using a Mac your in luck as Ruby is already installed on Snow Leopard and Lion! You&#8217;ll need a text editor though. Try <a href=\"http:\/\/www.barebones.com\/products\/textwrangler\/\">TextWrangler<\/a>. When you save files save them as myprogram.rb. To run them open up a terminal and type:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nruby myprogram.rb\r\n<\/pre>\n<p>You&#8217;ll need to make sure you&#8217;re in the same directory you saved your Ruby program to. By default TextWranger saves files to Documents so you&#8217;ll need to type:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ncd Documents\r\nruby myprogram.rb\r\n<\/pre>\n<p>I hope that gets you started if you&#8217;re using a Mac. There are lots of instructions on getting up and running on other platforms around.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve written my first post on a first, simple Ruby program. But I&#8217;ve not included notes there on installing and running Ruby programs. That&#8217;s because Ruby runs on a lot of different systems. And Ruby programs can be run in different ways. You can find advice on installing Ruby here. If you&#8217;re using a Mac [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-193","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-37","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/193","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=193"}],"version-history":[{"count":3,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/193\/revisions"}],"predecessor-version":[{"id":237,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/193\/revisions\/237"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}