Ruby On Rails 3 and Webrick issue

不羁的心 提交于 2019-11-29 12:22:08

Run these at the terminal:

gem install bundler
bundle

And then you should be able to boot the server.

Edit: You should really look into using rvm to manage your ruby installs and gemsets. It'll save you a lot of time and effort in installing them too.

Sean

I ran into the same problem as you (also attempting to go through the Lynda course), and also being a newbie I got pretty frustrated pretty quickly.

Buuuuut, after some searching, I found and answer here I got it to work.

First, I installed the 32-bit version of MySQL, as opposed to the 64-bit version, but I'm not sure if that made a difference.

Then, uninstall the Mysql gem

 gem uninstall mysql2

then reinstall it

sudo gem install mysql2

and finally

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql/lib/libmysqlclient.18.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.7/lib/mysql2/mysql2.bundle

and you should be good to go! Worked for me anyways. good luck!

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

This is the code that worked for me :D

I had the same problem. I simply ran the following code:

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

Press enter, and then run

rails server

and it worked!

Correct way that worked for me was:

cd ~ [command]

nano .bash_profile [command]

add this line of code:

export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"

ctrl+x [save]

y [yes]

cd Sites/sitename/ [command]

rails server [run WEBrick server]

and you should get this message:

=> Booting WEBrick
=> Rails 3.2.11 application starting in development on localhost:3000
=> Call with -d to detach

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!