Unable to start rails server

后端 未结 7 1933
[愿得一人]
[愿得一人] 2020-12-06 20:01

I have installed rails and mysql. I have also installed mysql2 gem. I created a rails application by the command rails new try_cms -d mysql It was created successfully. Bu

相关标签:
7条回答
  • sudo apt-get install libmysqlclient15-dev libmysqlclient15off libmysql-ruby
    
    0 讨论(0)
  • 2020-12-06 20:35

    If you want something a little less intrusive, just set the DYLD_LIBRARY_PATH environment variable in your MySQL's lib direction.

    export DYLD_LIBRARY_PATH=$MYSQL_HOME/lib
    
    0 讨论(0)
  • 2020-12-06 20:39

    I had similar problems. The solutio that worked for me was found here.

    0 讨论(0)
  • 2020-12-06 20:45

    Just ran into this problem myself. Make sure you update the version numbers.

    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

    0 讨论(0)
  • 2020-12-06 20:46

    For some reason the mysql2.bundle file was not in my mysql2 gem. I ran

     gem uninstall mysql2
    

    and the gem was uninstalled. Then I immediately ran

    sudo gem install mysql2
    

    Then

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

    Finally rails s launched the server!

    0 讨论(0)
  • 2020-12-06 20:52

    Try running this (see similar question here)

    sudo install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle
    
    0 讨论(0)
提交回复
热议问题