0

I ported a rails project from one machine to another and went through the following checklist to ensure the environment and system settings are good:

1) ruby -v =>

 ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0]

2) rails -v =>

 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
 1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir 
 /Users/AM/Documents/rubyws/overnights in PATH, mode 040777

 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
 1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir 
 /Users/AM/Documents/rubyws/overnights in PATH, mode 040777

 Rails 4.0.0

3) Check that mysql is running:

enter image description here

4) brew update

5) bundle install

6)rake db:create....... I get the following message on my terminal:

 AMs-MacBook-Pro:overnights AM$ rake db:create --trace

 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
 1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir 
 /Users/AM/Documents/rubyws/overnights in PATH, mode 040777
 rake aborted!
 dlopen(/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.14/lib/mysql2/mysql2.bundle, 
 9): Library not loaded: libmysqlclient.18.dylib
 Referenced from: /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-  
 0.3.14/lib/mysql2/mysql2.bundle
 Reason: image not found - /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-     
 0.3.14/lib/mysql2/mysql2.bundle
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `require'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/mysql2-0.3.14/lib/mysql2.rb:8:in `<top 
 (required)>'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-   
  1.3.5/lib/bundler/runtime.rb:72:in `require'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
  1.3.5/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler- 
  1.3.5/lib/bundler/runtime.rb:70:in `each'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
  1.3.5/lib/bundler/runtime.rb:70:in `block in require'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
  1.3.5/lib/bundler/runtime.rb:59:in `each'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-
  1.3.5/lib/bundler/runtime.rb:59:in `require'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195@global/gems/bundler-1.3.5/lib/bundler.rb:132:in 
 `require'
 /Users/AM/Documents/rubyws/overnights/config/application.rb:7:in `<top (required)>'
 /Users/AM/Documents/rubyws/overnights/Rakefile:4:in `require'
 /Users/AM/Documents/rubyws/overnights/Rakefile:4:in `<top (required)>'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in 
 `load'
/Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in 
`load_rakefile'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:637:in 
 `raw_load_rakefile'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:94:in 
 `block in load_rakefile'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:165:in 
 `standard_exception_handling'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:93:in 
 `load_rakefile'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:77:in 
 `block in run'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:165:in 
 `standard_exception_handling'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/lib/rake/application.rb:75:in 
 `run'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/rake:23:in `load'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/rake:23:in `<main>'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
 /Users/AM/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'

7) My understanding of this is that MySql is installed and running but somehow the rails application cannot find it: so I did "echo $PATH"

 /Users/AM/.rvm/gems/ruby-2.0.0-p195/bin:/Users/AM/.rvm/gems/ruby-2.0.0-
  p195@global/bin:/Users/AM/.rvm/rubies/ruby-2.0.0-
  p195/bin:/Users/AM/.rvm/bin:/usr/local/bin:/usr/local/sbin:
  ~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin

8) Then I wanted to find where MySQL was installed so I went to: cd /usr/local/ ls -la

I saw this:

 drwxrwxr-x  21 root  admin    714 11 Jan 08:25 .
 drwxr-xr-x@ 13 root  wheel    442  1 Jun  2013 ..
 drwxr-xr-x  14 AM    admin    476 11 Jan 08:25 .git
 -rw-r--r--   1 AM    admin    213 20 May  2013 .gitignore
 -rw-r--r--   1 AM    admin    592 11 Jan 08:25 CONTRIBUTING.md
 drwxr-xr-x  22 AM    admin    748 11 Jan 08:32 Cellar
 drwxr-xr-x  10 AM    admin    340 11 Jan 08:25 Library
 -rw-r--r--   1 AM    admin   1240 11 Jan 08:25 README.md
 -rw-r--r--   1 AM    admin  23510 11 Jan 08:25 SUPPORTERS.md
 drwxr-xr-x  79 AM    admin   2686 11 Jan 08:33 bin
 drwxr-xr-x   6 AM    admin    204 11 Jan 08:33 etc
 drwxr-xr-x   6 AM    admin    204  2 Jun  2013 foreman
 drwxr-xr-x   7 AM    admin    238  2 Jun  2013 heroku
 drwxr-xr-x  46 AM    admin   1564 29 Aug 15:21 include
 drwxr-xr-x  50 AM    admin   1700 29 Aug 15:21 lib
 drwxr-xr-x   5 root  wheel    170 29 Mar  2013 man
 lrwxr-xr-x   1 root  wheel     27 17 Sep 15:47 mysql -> mysql-5.6.13-osx10.7-x86_64
 drwxr-xr-x  17 root  wheel    578 17 Sep 15:47 mysql-5.6.13-osx10.7-x86_64
 drwxr-xr-x  22 AM    admin    748 11 Jan 08:33 opt
 drwxr-xr-x  17 AM    admin    578 29 Aug 15:21 share
 drwx------   6 AM    admin    204 11 Jan 08:33 var

So I now feel that I am almost there, but need the last few steps to make this rails app work. Can someone help me figure out what to do next?

Thanks

banditKing
  • 9,405
  • 28
  • 100
  • 157

1 Answers1

1

You can try running this to include libmysqlclient.18.dylib into search path

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

I also found similar case

Community
  • 1
  • 1
Ilya Cherevkov
  • 1,743
  • 2
  • 17
  • 47
  • where do I type this in? Is there a more permanent solution so that I dont have to keep running a script everytime. Like can I set this somewhere so that it stays?Thanks – banditKing Jan 11 '14 at 18:30
  • 1
    just copy into terminal. command creates symbolic link between two paths – Ilya Cherevkov Jan 11 '14 at 18:37