在执行rails generate controller foldera index的时候报错:
/Users/jli1/.rvm/gems/ruby-1.9.3-p429@global/gems/mysql2-0.3.21/lib/mysql2.rb:31:in `require’: dlopen(/Users/jli1/.rvm/gems/ruby-1.9.3-p429@global/gems/mysql2-0.3.21/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
貌似mysql2 gem包的问题,卸载后重装,gemfile添加gem ‘mysql2’, ‘0.3.21’,执行bundle install,问题依旧。
后中执行命令行 sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib。问题解决!
rails generate controller报错
最新推荐文章于 2022-06-15 15:17:08 发布