mysqldump doesn’t work on OSX Lion

Standard

-bash: mysqldump: command not found

So how do you fix this? Well, just copy and paste the following into your terminal window and press enter:

echo export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" >> ~/.profile

source ~/.profile

Advertisements

Possible problems with rails + mysql on OS X Lion

Standard

If you are trying to run your app with Rails and you got some errors when execute the rake db:migrate It is possible that you must to install the GCC. In Lion installation there is no gcc default. You can check GCC here: https://github.com/kennethreitz/osx-gcc-installer

Other possible error is the lack of a  symbolic link:

( Library not loaded: libmysqlclient.18.dylib )

ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

With these changes you may run successful the mysql + rails in your app.

Remembering that is a good practice to reinstall your gem after these changes:

gem uninstall mysql2

bundle install

Problems with Ruby on Mac OS X – Lion

Standard

When I’ve updated to Mac OS X Lion, I’ve found some error running rails application. The problem was  with my ruby installation. I got some sqlite3 errors, then I need to updated my Xcode to 4.3 version and install the Command Line Tools(Xcode->Preferences->Downloads).

After this, some errors appear:

ERROR:  Error installing sqlite3: ERROR: Failed to build gem native extension. 

and

try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first. 

Solution:

Reinstall ruby

rvm reinstall 1.9.2

But you may to get this message:

The provided compiler '/usr/bin/gcc' is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.

So you can use:

rvm reinstall 1.9.2 --with-gcc=clang