Ruby On Rails 3 and Webrick issue

后端 未结 5 696
余生分开走
余生分开走 2020-12-20 03:26

Thanks for taking a look at this.

I started a beginner\'s tutorial on RoR through lynda.com. I followed the instructions to the letter. Everything was working so far

相关标签:
5条回答
  • 2020-12-20 03:52

    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

    0 讨论(0)
  • 2020-12-20 03:58

    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.

    0 讨论(0)
  • 2020-12-20 03:59

    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!

    0 讨论(0)
  • 2020-12-20 04:01

    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!

    0 讨论(0)
  • 2020-12-20 04:12
    export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/
    

    This is the code that worked for me :D

    0 讨论(0)
提交回复
热议问题