Tag Archives: ruby

Installing Ruby 1.9.3 — errors and solutions!

We’re using Ruby 1.9.2-p194 for HelloRubyTuesdays at our weekly Women Who Code Rails night! So it was time for me to install 1.9.3. I ran into two errors before I got a successful install, so here’s how google searches helped me fix them.

1. When I first typed $ rvm install ruby-1.9.3-p194, I got this error, which ended like:

error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn't adequate, you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
ERROR: There was an error, please check /Users/judytuna/.rvm/log/ruby-1.9.3-p194/*.log
ERROR: There has been an error while trying to fetch the source.
Halting the installation.
ERROR: There has been an error fetching the ruby interpreter. Halting the installation.

Wut? Can’t download? Is there something wrong with my curl? Do I have to pull in a bundle of certificates? Initial searching suggested downloading certificates, but I kept looking for a simpler solution. Finally, this answer on stackoverflow provided a fix that was easy to try, and I knew it wouldn’t break anything–it suggested updating rvm, which has the new certificates, and pointed out that rvm doesn’t live at beginrescueend.com anymore. The command to update rvm is also viewable at rvm.io. It is as follows:

$ curl -L https://get.rvm.io | bash -s stable

After that, rvm was able to download the ruby I wanted!

2. So the installation progressed like so, until…

judymbp:HelloRubyTuesdays judytuna$ rvm install ruby-1.9.3-p194
Installing Ruby from source to: /Users/judytuna/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...

ruby-1.9.3-p194 - #downloading ruby-1.9.3-p194, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9610k 100 9610k 0 0 385k 0 0:00:24 0:00:24 --:--:-- 449k
ruby-1.9.3-p194 - #extracting ruby-1.9.3-p194 to /Users/judytuna/.rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #extracted to /Users/judytuna/.rvm/src/ruby-1.9.3-p194
ruby-1.9.3-p194 - #configuring
ruby-1.9.3-p194 - #compiling
Error running 'make ', please read /Users/judytuna/.rvm/log/ruby-1.9.3-p194/make.log
There has been an error while running make. Halting the installation.

Opening up the log file showed me a whole bunch of warning: implicit conversion shortens 64-bit value into a 32-bit value all over the place, and then this at the end:

tcltklib.c: In function ‘tcltklib_compile_info’:
tcltklib.c:10032: warning: implicit conversion shortens 64-bit value into a 32-bit value
linking shared-object tcltklib.bundle
ld: in /usr/local/lib/libiconv.2.dylib, missing required architecture x86_64 in file for architecture x86_64
collect2: ld returned 1 exit status
make[2]: *** [../../.ext/x86_64-darwin11.4.0/tcltklib.bundle] Error 1
make[1]: *** [ext/tk/all] Error 2
make: *** [build-ext] Error 2

So, something about 32-bit vs 64-bit. One of the google searches turned up a pragprog forum thread, and Sam R’s post linked to a blog post celebrating the release of 1.9.3 which contained a solution to my problem! make was using the libiconv.2.dylib in /usr/local/lib/, but we want to use the one in /usr/lib. You can see that the /user/lib one is the one that had x86_64 by looking at the file output of those files:

judymbp:HelloRubyTuesdays judytuna$ file /usr/local/lib/libiconv.2.dylib
/usr/local/lib/libiconv.2.dylib: Mach-O universal binary with 2 architectures
/usr/local/lib/libiconv.2.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libiconv.2.dylib (for architecture ppc): Mach-O dynamically linked shared library ppc
judymbp:HelloRubyTuesdays judytuna$ file /usr/lib/libiconv.2.dylib
/usr/lib/libiconv.2.dylib: Mach-O universal binary with 2 architectures
/usr/lib/libiconv.2.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64
/usr/lib/libiconv.2.dylib (for architecture i386): Mach-O dynamically linked shared library i386

So I backed up the one at /usr/local/lib (because I’m paranoid, I guess) and followed the instructions in the blog post to symlink that location to the one in /usr/lib. Here’s what I did:

$ sudo mv /usr/local/lib/libiconv.2.dylib /usr/local/lib/libiconv.2.dylib.bak
$ ln -s /usr/lib/libiconv.2.dylib /usr/local/lib/libiconv.2.dylib

and then $ rvm install ruby-1.9.3-p194 worked. Yay!

Wikipedia SF Hackathon! BERLIN HO!!!

I went to the Wikipedia SF Hackathon this weekend at Parisoma! Neil and I coded a phone gateway for the English Wikipedia on Twilio. You send it a text with your search query (like “Barak Obama” or “Seattle”) and it calls you back in a few seconds and reads you the entire text of the article. =D

CODE: https://github.com/judytuna/SMS-Wikipedia — it calls the Twilio API, in Ruby, using Sinatra, hosted on Heroku. I wouldn’t have been able to do any of this if Twilio (the amazing Sasha is the best developer evangelist ever), Ruby (sfruby.info like woah), and Heroku (who sponsored one of my early wwcode-rails meetups, and also sponsors Blazing Cloud sponsorships!) didn’t have the community presence that they do. Seriously, I can’t believe I get to live in San Francisco where all of this is happening RIGHT NOW. Look at this technology! Look at what it’s enabling us to do!

Romy wrote super-comprehensive notes on our product and process and drew pictures here: http://www.mediawiki.org/wiki/San_Francisco_Hackathon_January_2012/Teams#Wikipedia_SMS_.2B_IVR_on_Twilio

On Thursday, I had gotten an email urging us to check out the project ideas, and came up with the SMS gateway idea and added it to the project page.

Why did I want to do this so badly?

  • I didn’t have a smartphone until December and always wished I could look stuff up on Wikipedia when I wasn’t near a computer.
  • When we get phone tree stuff working, this could be used by illiterate or blind people.
  • In areas where access to tech is low but phones (not smartphones) are ubiquitous, this could be a way for people to look stuff up on wikipedia. This is mind-blowing.

It was an amazing experience and I learned so much from Neil and our team won first place!!!!!! The prize: flight and hotel to another wikimedia hackathon. The next one will be in Berlin in May!!!!!!!!!!!!! I’ve never been to Berlin! I’ve been to Europe once–London and York, with my high school choir, in 2000.

We have lots of ideas for the next steps of this app. I am considering setting up a kickstarter (as long as it’s okay with the wikimedia foundation??) to pay twilio for the app (actually I have no idea about this…)… It’s still in the “twilio sandbox” for now so I can’t show it to you yet (because your number has to be a “verified number” for MY twilio account in order for it to call you back I think). But I’m about to put my credit card info in so I’ll be able to show it off to the world soon.

The app definitely works =)

At the Hackathon, I REALLY enjoyed the PhoneGap demo. Tomasz and Yuvi showed us the Wikipedia app that they just pushed to the Android store last week, and guided us through adding a menu item. js! css! wow!!! I think the tutorial that they used would be ideal for a Railsbridge-style workshop (it starts with “how to get stuff installed” and it was surprisingly fast and easy).

So PhoneGapBridge is incoming. I’ll plan it 2 weeks off of a Railsbridge. =D

I’m learning so much. I met so many amazing, amazing people. I got interviewed by Wikimedia Foundation Storyteller Victor–how cool is his job title? I got my picture taken with leaves. I told him that I had serious class issues and loved online communities and want everyone to have access to information and nothing scares me more than loss of free speech and was generally completely incoherent but I kept banging on my knees the whole time because of HOW EXCITED I AM.

Judy with Leaves
I am a dork

I wondered where I’d seen Toki Wartooth Brandon and then realized this morning that it was the fundraising banners! I basically couldn’t believe I was there all weekend. They’re right here in San Francisco!

I told everybody who would listen about Lukas and Elsa’s Occupedia, which is an initiative to create meetups that encourage underrepresented groups to contribute to wikipedia. Lukas wrote about the first event and I showed everybody haha.

I fucking love wikipedia. I love the wikimedia foundation. I want more. I was talking to Daniel from Germany, who said “I want to see a separate mobile app for a different set of users — the ones that spend a lot of their idle time patrolling new edits. There should be an app that lets them to it easily at the bus stop.” PHONEGAP HOOOOOOOOO

Sumanah was amazing and kept things going and was crazy and enthusiastic and welcoming. I met Leslie, a network engineer, who knew someone else that I knew from Railsbridge. I talked to Danielle (women in tech!), Elizabeth (Android!), and Rosemarie (who I’d met at wwcode-rails!). Phil asked me how I was going to pay Twilio for it D: I learned about Microsoft’s bridges with open source from Ben and Doug and it was fascinating and I tried asking them about openkinect/k4w, but their department doesn’t interface with xbox stuff =) I met Rupa of CodeChix and there are machinations afoot.

AAHHHHHHH!!!!!!!!!!!!! I AM SO EXCITED!!!!!!!!!!!!!!!!!!!!!!!!!!!!!