After a ton of comments privately about using Homebrew instead of Macports I decided to try it out. I did a clean install on my Macbook Pro and here are the steps I followed.
1. Install Xcode 4.6 and command line tools.
2. Open terminal and run command:
\curl -L https://get.rvm.io | bash -s head --ruby
3. Enjoy ruby.
That is much easier. So much easier! Apparently rvm head will install Homebrew, all the required dependencies, and build a working copy of ruby. The #rvm channel on freenode helped me with this. I am now upset at the time I wasted trying to get the other way to work.
This may be old news to some but I wanted to throw this up because I spent a ton of time Googling and did not find a good solution, I hope this helps others. Now I am going to build the ultimate post reinstall script for setting up OSX for security people!
Showing posts with label Ruby. Show all posts
Showing posts with label Ruby. Show all posts
Thursday, February 21, 2013
Tuesday, February 12, 2013
Ruby 1.9.3 on OSX Mountain Lion with Mac Ports and RVM
I the latest generation of Macbook Pro for most of my development and testing. A good way to work with Ruby is a requirement for my daily tasks. I usually use RVM to manage everything. After a fresh install of OSX I kept getting stopped doing an install of 1.9.3. The errors are mostly related to integer conversion or linking. After several days of pulling teeth, running debuggers, and read script code I finally have a working Ruby install. For reference my exact steps are:
I am not saying all of these steps are required, its just what I found to work. Why Mountain Lion ships with ancient versions of tools like Ruby and curl is beyond me. I left out a few steps from the clean install to the current running version but they were cosmetic changes (Terminal coloring), a Firefox install, and a TextMate install that didn't have any impact on the Ruby installation.
1. Clean install of OSX.And I got:
2. Apply all current updates (bringing my system to 10.8.2)
3. Install Xcode (version 4.6) and command line tools
4. Install MacPorts (2.1.3 10.8)
5. sudo port selfupdate -v
6. sudo port upgrade outdated
7. sudo port install apple-gcc42
8. sudo port install gmake
9. sudo port install gpatch
10. sudo port install binutils
11. sudo ln -s /opt/local/bin/gcc-apple-4.2 /opt/local/bin/gcc
12. sudo ln -s /opt/local/bin/gmake /opt/local/bin/make
13. sudo ln -s /opt/local/bin/gpatch /opt/local/bin/patch
14. sudo port install curl
15. curl -L https://get.rvm.io | bash -s stable
16. Add "source ~/.profile" to top of .bash_profile
17. Reboot ("Reopen windows after reboot" is unchecked)
18. rvm install 1.9.3 in Terminal
Davids-MacBook-Pro:~ dmaynor$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p385.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/dmaynor/.rvm/archives
######################################################################## 100.0%
Extracting yaml to /Users/dmaynor/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/dmaynor/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/dmaynor/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/dmaynor/.rvm/usr
Installing Ruby from source to: /Users/dmaynor/.rvm/rubies/ruby-1.9.3-p385, this may take a while depending on your cpu(s)...
ruby-1.9.3-p385 - #downloading ruby-1.9.3-p385, this may take a while depending on your connection...
######################################################################## 100.0%
ruby-1.9.3-p385 - #extracting ruby-1.9.3-p385 to /Users/dmaynor/.rvm/src/ruby-1.9.3-p385
ruby-1.9.3-p385 - #extracted to /Users/dmaynor/.rvm/src/ruby-1.9.3-p385
ruby-1.9.3-p385 - #configuring
ruby-1.9.3-p385 - #compiling
ruby-1.9.3-p385 - #installing
Retrieving rubygems-1.8.25
######################################################################## 100.0%
Extracting rubygems-1.8.25 ...
Removing old Rubygems files...
Installing rubygems-1.8.25 for ruby-1.9.3-p385 ...
Installation of rubygems completed successfully.
Saving wrappers to '/Users/dmaynor/.rvm/bin'.
ruby-1.9.3-p385 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p385 - #importing default gemsets, this may take time ...
Install of ruby-1.9.3-p385 - #complete
Davids-MacBook-Pro:~ dmaynor$
I am not saying all of these steps are required, its just what I found to work. Why Mountain Lion ships with ancient versions of tools like Ruby and curl is beyond me. I left out a few steps from the clean install to the current running version but they were cosmetic changes (Terminal coloring), a Firefox install, and a TextMate install that didn't have any impact on the Ruby installation.
Monday, June 23, 2008
Ruby vulns: its been 3 years in the making
After a busy weekend, I come back to the magic of RSS to find multiple security holes in Ruby. I had heard about this last week but could not find any details. It seems that more information comes in the form of an Apple Security team member, Drew Yao, who made the discoveries. You can read more about it at Matasano or from ruby-lang.
These finds are very cool and I have always been interested in bugs in interpreted languages mostly because people think they are a “more secure” standard by some folks because they think the memory corruption angle is no longer an issues.
The first time I saw anybody publicly talk about this problem and a potential attack was Blackhat Tokyo by Dom Brezinski. Actually when I say “I saw the talk” I mean I was sitting next to him in the speaker room discussing the problem afterward because I was giving a talk opposite of him on how to break security tools. The previous statement is to head off the trolls who will undoubtedly comment about my lack of actually seeing the talk because I was scheduled at the same time.
These finds are very cool and I have always been interested in bugs in interpreted languages mostly because people think they are a “more secure” standard by some folks because they think the memory corruption angle is no longer an issues.
The first time I saw anybody publicly talk about this problem and a potential attack was Blackhat Tokyo by Dom Brezinski. Actually when I say “I saw the talk” I mean I was sitting next to him in the speaker room discussing the problem afterward because I was giving a talk opposite of him on how to break security tools. The previous statement is to head off the trolls who will undoubtedly comment about my lack of actually seeing the talk because I was scheduled at the same time.
Subscribe to:
Posts (Atom)