Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby, RVM, LLVM and MySQL

I'm having big trouble in configuring Ruby and MySQL on MacOSX. Just a fact, I'm new on MacOSX and Ruby On Rails.

So, first I was having problems to install mysql2 gem, after get the gem installed I was trying developer a test, and when I tried start the WEBrick got this error saying that couldn't load a MySQL lib called "libmysqlclient.18.dylib". Googlin' about the error I saw that everyone was recommending using Ruby through RVM. I installed RVM and tried install ruby 1.9.3 and get this error:

ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read rvm requirements.

I'm almost giving up learn Rails, setup a development environment shouldn't be that painful. On Windows I got no problems.

like image 662
MaltMaster Avatar asked Nov 03 '11 18:11

MaltMaster


3 Answers

Unfortunately, you're trying Rails at a bit of a bad time. There's a lot of transition at the moment, as others have mentioned Xcode 4.2 was recently released and has a new compiler, also Ruby 1.9.3 came out.

I've been developing Ruby and Rails for some years now, but trying to get up and running again after installing Lion clean this week has been more problematic than in the past.

First, make sure RVM is up to date (as the issue should be fixed):

rvm get head

Then try installing like so:

CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared

EDIT:

Note, working through my own issues I believe the first command probably fixed the problem. The second wouldn't have provided any benefit over:

rvm install 1.9.3

As on my clean install, /usr/bin/gcc-4.2 doesn't exist.

Also I wanted to add that I ended up compiling the older GCC manually for those situations where the new compiler fails. I followed this very informative blog post.

like image 83
Delameko Avatar answered Oct 17 '22 09:10

Delameko


add --with-gcc=clang as a parameter:

rvm install ruby-1.9.3 --with-gcc=clang
like image 48
Anno2001 Avatar answered Oct 17 '22 08:10

Anno2001


Did you install the latest Xcode from Mac Store?

here is a nice guide i followed to update my ruby/Rails to 1.9.2/3.0

guide

good luck

like image 3
Cygnusx1 Avatar answered Oct 17 '22 09:10

Cygnusx1