ruby on rails mac x os lion run server LoadError - ruby-on-rails

When I type the rails server on terminal, I got the following error.
I don't know how to fix it. Is any one can give me a help?
And I also need a ruby on rails mac os x Lion installation tutorial.
:simple_cms benhuayang$ rails server
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `require':
dlopen(/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from:
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found -
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/mysql2-0.3.11/lib/mysql2.rb:9:in `<top (required)>' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/gems/bundler-1.0.21/lib/bundler.rb:122:in `require' from
/Users/benhuayang/Sites/simple_cms/config/application.rb:7:in `<top (required)>' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:53:in `require' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:53:in `block in ' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap' from
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>' from
script/rails:6:in `require' from
script/rails:6:in `<main>'
this is path for mysql
/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0/bin:/Users/benhuayang/.rvm/gems/ruby-1.9.3-p0#global/bin:/Users/benhuayang/.rvm/rubies/ruby-1.9.3-p0/bin:/Users/benhuayang/.rvm/bin:/opt/local/bin:/opt/local/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

When I've run into this in the past, I've used the following solution.
In the terminal, run:
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/usr/local/mysql/lib"
Then try running your rails server command in the root of your app. If it works, just put that same command into your ~/.profile so that it runs each time you enter the terminal.

Ryan's solution worked for me when I had the following error after running rake db:migrate, I figured posting it will help with the google search.
rake aborted!
dlopen(/Users/[USERNAME]/.rvm/gems/ruby-1.9.3-p286/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/[USERNAME]/.rvm/gems/ruby-1.9.3-p286/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/[USERNAME]/.rvm/gems/ruby-1.9.3-p286/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
(See full trace by running task with --trace)

Related

Rails Server Error - Rails 4

I am trying to come back to create another application on Rail4 and When I try to start the application this is what happened:
prompt$ rails server
/Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2.rb:31:in `require': dlopen(/Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/edwincaro/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/edwincaro/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2/mysql2.bundle
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/mysql2-0.4.5/lib/mysql2.rb:31:in `<top (required)>'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
from /Users/ec/Sites/ticketsys/config/application.rb:7:in `<top (required)>'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from /Users/ec/.rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
prompt$
I read all the 'Rails Server Error' posted previously here and tried most of the solution offered here but none of them worked for me.
I am thinking that maybe is the file dlopen what I am missing.
I will appreciate any help please
You need to reinstall your mysql library. Then:
gem uninstall mysql2
bundle install
To rebuild the gem against the new mysql library

rails server bin/rails:6: warning: already initialized constant APP_PATH error

I'm using Ubuntu 14.04 and I'm a beginner using Ruby on Rails
I recently installed rbenv, ruby 2.3.0 and rails 4.2.4 following the tutorial: https://gorails.com/setup/ubuntu/14.04
After installation, I ran ruby -v and rails -v and got the expected versions. So far so good. Then I ran rails s and I got:
rails server bin/rails:6: warning: already initialized constant APP_PATH error
To fix it I ran:
rake rails:update:bin following this StackOverflow question: rails server bin/rails:6: warning: already initialized constant APP_PATH error which resulted to a new error (I also removed Spring gem):
Gem::LoadError: You have already activated rake 10.4.2, but your Gemfile requires rake 10.5.0. Prepending `bundle exec` to your command may solve this.
/my-home-directory/my-ruby-on-rails-project/config/boot.rb:3:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/config/application.rb:1:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/Rakefile:4:in `<top (required)>'
LoadError: cannot load such file -- bundler/setup
/my-home-directory/my-ruby-on-rails-project/config/boot.rb:3:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/config/application.rb:1:in `<top (required)>'
/my-home-directory/my-ruby-on-rails-project/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
I prepend 'bundle exec' and got the following error:
/my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri.rb:29:in `require': libruby.so.2.2: cannot open shared object file: No such file or directory - /my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri/nokogiri.so (LoadError)
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri.rb:29:in `rescue in <top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/nokogiri-1.6.7.2/lib/nokogiri.rb:25:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog/xml.rb:1:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog/xml.rb:1:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog.rb:11:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/fog-1.23.0/lib/fog.rb:11:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `<top (required)>'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:77:in `block (2 levels) in require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /my-home-directory/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /my-home-directory/my-ruby-on-rails-project/config/application.rb:7:in `<top (required)>'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `require'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /my-home-directory/my-ruby-on-rails-project/.bundle/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:8:in `require'
from bin/rails:8:in `<main>'
Before installing rbenv, I was using RVM and I had the same errors popping around. I can't figure out what changes I've done when I started having these issues.
For the sake of my sanity, any help is very appreciated!
Thank you all!
A friend of mine just helped me and fixed this.
What he suggested:
Create a file .ruby-version in my project directory with one line: ruby-2.3.0 - This will make sure that we're not loading another nokogiri version
Remove the bundler by running: rm -rfv .bundle
Then run: bundle
Run: bundle exec rails s
Works like a charm.
I asked him why he thinks I had these issues and said: Hard to say, a messed up .bundle directory can do a lot of funky stuff.

Rails - cannot run rake command because of "libMagickCore.5.dylib"

When I run run rake db:create, I get this error statement:
rake aborted!
dlopen(/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/lib/libjpeg.8.dylib
Referenced from: /usr/local/opt/imagemagick/lib/libMagickCore.5.dylib
Reason: Incompatible library version: libMagickCore.5.dylib requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0 - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/Users/adam/rubydev/app-staging/config/application.rb:13:in `<top (required)>'
/Users/adam/rubydev/app-staging/Rakefile:5:in `require'
/Users/adam/rubydev/app-staging/Rakefile:5:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
I spent whole afternoon with looking for an issue and how to fix it, but without success.
The problematic part is here:
Referenced from: /usr/local/opt/imagemagick/lib/libMagickCore.5.dylib
Reason: Incompatible library version: libMagickCore.5.dylib requires version 13.0.0 or later, but libjpeg.8.dylib provides version 12.0.0 - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
How can I upgrade libMagickCore.5.dylib on OS X Lion?
Thank you in advance
EDIT: After reinstalling imagemagick I ran rake db:create and got:
rake db:createrake aborted!
dlopen(/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle, 9): Library not loaded: /usr/local/opt/imagemagick/lib/libMagickCore.5.dylib
Referenced from: /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
Reason: image not found - /Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/RMagick2.bundle
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/gems/rmagick-2.13.1/lib/rmagick.rb:11:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:66:in `block in require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `each'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler/runtime.rb:55:in `require'
/Users/adam/.rvm/gems/ruby-1.9.3-p327#global/gems/bundler-1.2.2/lib/bundler.rb:128:in `require'
/Users/adam/rubydev/app-staging/config/application.rb:13:in `<top (required)>'
/Users/adam/rubydev/app-staging/Rakefile:5:in `require'
/Users/adam/rubydev/app-staging/Rakefile:5:in `<top (required)>'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
/Users/adam/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
(See full trace by running task with --trace)
Try gem pristine rmagick from the command-line.
Reference: https://github.com/mroth/lolcommits/issues/65
I had a similar problem in the past and simply ran a software update on the operating system and on the developer tools.
If that doesn't solve the problem, you can also try removing and reinstalling imagemagic with homebrew by running:
brew update
brew remove imagemagick
brew install imagemagick

Library not loaded: libpq.5.dylib

I have app that is running Ruby 1.9.2, Rails 3, and postgreSQL 8.3. It was originally setup and working with postgreSQL 9.1, but I uninstalled 9.1 and installed and changed to 8.3 insure compatibility on a Heroku shared database setup. It was running ok, but it's not now
Now, when working on this app, when I run a database upgrade I get this error:
dlopen(/Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg_ext.bundle, 9): Library not loaded: libpq.5.dylib
Referenced from: /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg_ext.bundle
Reason: no suitable image found. Did find:
/usr/lib/libpq.5.dylib: no matching architecture in universal wrapper - /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg_ext.bundle
And when I try to run the server I get this error message:
/Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg.rb:4:in `require': dlopen(/Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg_ext.bundle, 9): Library not loaded: libpq.5.dylib (LoadError)
Referenced from: /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg_ext.bundle
Reason: no suitable image found. Did find:
/usr/lib/libpq.5.dylib: no matching architecture in universal wrapper - /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg_ext.bundle
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/pg-0.12.2/lib/pg.rb:4:in `<top (required)>'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290#global/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /Users/michaeljmccoy/www/mikemccoy/config/application.rb:7:in `<top (required)>'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc2/lib/rails/commands.rb:53:in `require'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc2/lib/rails/commands.rb:53:in `block in <top (required)>'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc2/lib/rails/commands.rb:50:in `tap'
from /Users/michaeljmccoy/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0.rc2/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I know they are very similar errors and probably has to do with a missing path. However, when I add the path to my .profile file and restart the terminal window, I get the same errors.
You may need to remove and re-install the pg gem, so it's compiled against the correct version of Postgres.
For anyone seeing this error and running PostgresApp, this is a known problem that was fixed in version 9.2.4.3:
Discussion: https://github.com/PostgresApp/PostgresApp/issues/109
Installer: https://github.com/PostgresApp/PostgresApp/releases/tag/9.2.4.3
Of course, you could just grab the latest version (http://postgresapp.com/). Both versions got me back up and running with Rails 3.2.14 and Ruby 2.0.0. However, note that when I installed 9.2.4.3 my databases were still listed in psql, but when I installed 9.3.0 (the current version at the moment), my databases were no longer listed.

Rails server won't run with mysql2 gem

**I know this is a popular issue here, but I just can't seem to get it to run. I've tried just about everything I've read, and the issue persist.
I'm using RVM and 1.9.2. I'm also using MySQL 5.5, and I've reinstalled it several times. My installation of Ruby seems to work well with SQLite, but it chokes on MySQL. I've checked to see if MySQL is working through PHP too, so I know that's not the issue. Rails just can't seem to find the "libmysqlclient.18.dylib" file.
Here's what happens when I run the server:**
littleMac$ sudo rails s
/Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /Users/littleMac in PATH, mode 040777
/Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /Users/littleMac in PATH, mode 040777
/Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/mysql2-0.2.11/lib/mysql2.rb:9:in `require': dlopen(/Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
Referenced from: /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
Reason: image not found - /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/mysql2-0.2.11/lib/mysql2/mysql2.bundle
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/mysql2-0.2.11/lib/mysql2.rb:9:in `<top (required)>'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `require'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `each'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:66:in `block in require'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `each'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler/runtime.rb:55:in `require'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/bundler-1.0.15/lib/bundler.rb:120:in `require'
from /Users/littleMac/sites/TestBox2/config/application.rb:7:in `<top (required)>'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:28:in `require'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:28:in `block in <top (required)>'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:27:in `tap'
from /Users/littleMac/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.0.9/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
If you are using RVM chances are you don't want to sudo.
Please also format your code in a code block to make it easier for people to help.
Read this post. It seems to be identical.

Resources