I\'ve tried a number of things like uninstalling/reinstalling rails and gems but to no avail.
When I go into my new project and run rails s or bundle exec rails serv
I received this error after upgrading postgresql.
$ gem uninstall pg
$ gem install pg
resolved this issue for me.
Run these in console:
rake tmp:clear
rake secret
I'll post what worked for me.
Comment out
gem 'spring'
Add gem 'net-shh'
and run bundle install
And restart your sever
Are you using pg and mysql in different branches ? If yes, please confirm db config file.
If you are on El Capitan (OS X 10.11), Security Integrity Protection (SIP) will prevent linking into /usr/lib to fix mysql. Link it into /usr/local/lib instead:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib
I got the same error. I had ruby 2.1.3 and rails 4.1.6 running on Mavericks and then I migrated to Yosemite and installed the 4.2.0 rails version an ruby 2.1.5 and my apps I made in the previous version didn't work with the new one, so I made some gem sets with RVM and installed the 2.1.3 version. Now when I wanted to run the server I got these error:
bin/rails:6: warning: already initialized constant APP_PATH
/Users/Lexynux/_WebProjects/RoR_Apps/SAIIP2/bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]
And as tobu mentioned I ran:
rake rails:update:bin
I got this:
LoadError: dlopen(/Users/Lexynux/.rvm/gems/ruby-2.1.3@SAIIP2/extensions/x86_64-darwin-14/2.1.0-static/mysql2-0.3.16/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib
Then I ran this:
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
And finally I repeated the first command it the terminal asked me for this:
Overwrite /Users/Lexynux/_WebProjects/RoR_Apps/SAIIP2/bin/rails? (enter "h" for help) [Ynaqdh]
I just typed 'Y' and hit return.
After all this I started working and going well.
Thanks.