Installing Rails on a Mac
What a lot of grief!
After trying more simple steps on another site (and failing) I eventually managed to get the following steps to work:
http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx
There were however some changes:
01: Make sure you download TextMate. I kept reading it as TextEdit for some reason, so just be aware of that when "mate ~/.bash_login" wont work.
02: One of the steps tells you to type "make ~/.bash_login". I found that adding the suggested text to that file made no difference when you log out/in or close the Terminal window. This was because a file named "~/.bash_profile" existed. If this file exists then you should modify it instead of the one mentioned in the article.
03: When trying to do "rake db:migrate" I would experience the following error:
otherwise you will experience the following error:
This is because the latest version of MySql has changed a path from lib/mysql to just lib/. To fix this problem you need to type the following (it's all one line):
Right then. Now that those Hellish few days are over it's time to get annoyed with trying to write a website I suppose :-)
After trying more simple steps on another site (and failing) I eventually managed to get the following steps to work:
http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx
There were however some changes:
01: Make sure you download TextMate. I kept reading it as TextEdit for some reason, so just be aware of that when "mate ~/.bash_login" wont work.
02: One of the steps tells you to type "make ~/.bash_login". I found that adding the suggested text to that file made no difference when you log out/in or close the Terminal window. This was because a file named "~/.bash_profile" existed. If this file exists then you should modify it instead of the one mentioned in the article.
03: When trying to do "rake db:migrate" I would experience the following error:
otherwise you will experience the following error:
dyld: NSLinkModule() error
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Reason: image not found
Trace/BPT trap
This is because the latest version of MySql has changed a path from lib/mysql to just lib/. To fix this problem you need to type the following (it's all one line):
sudo install_name_tool -change /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib /usr/local/mysql/lib/libmysqlclient.15.dylib /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/lib/mysql.bundle
Right then. Now that those Hellish few days are over it's time to get annoyed with trying to write a website I suppose :-)
Comments
for i in *dylib ; do \
sudo install_name_tool -id $PWD/$i $i; \
done
run from /usr/local/mysql/lib.
Otherwise, smooth sailing
cheers
sudo install_name_tool -change /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib /usr/local/mysql/lib/libmysqlclient.15.dylib /usr/local/lib/ruby/gems/1.8/gems/do_mysql-0.9.1/lib/do_mysql_ext.bundle
Thanks, would never have worked that out!
After reinstall mysql sinatra don't run and show message like:
LoadError: dlopen(/usr/local/lib/ruby/gems/1.8/gems/do_mysql-0.10.0/lib/do_mysql_ext.bundle, 9): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.16.dylib
Using datamapper with sinatra do_mysql
try this
sudo install_name_tool -change /usr/local/mysql/lib/mysql/libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /usr/local/lib/ruby/gems/1.8/gems/do_mysql-0.10.0/lib/do_mysql_ext.bundle
and works on