mardi 3 octobre 2017

cannot run rails server [mysql projects only]

i'm using mac & new in rails
when i type $ sudo rails new website
it does the job and i'm able to run the server

i'm sure that mysql is running with no error's
i installed mysql2 and ruby-mysql gem's

but when i try $ sudo rails new website -d mysql
i can't start the server!
when i try to run the server $ sudo rails server, it says:
/Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/mysql2-0.4.9/lib/mysql2.rb:31:inrequire': dlopen(/Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/mysql2-0.4.9/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError) Referenced from: /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/mysql2-0.4.9/lib/mysql2/mysql2.bundle Reason: image not found - /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/mysql2-0.4.9/lib/mysql2/mysql2.bundle from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/mysql2-0.4.9/lib/mysql2.rb:31:in <top (required)>' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:82:inrequire' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:82:in block (2 levels) in require' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:77:ineach' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:77:in block in require' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:66:ineach' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler/runtime.rb:66:in require' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/bundler-1.15.4/lib/bundler.rb:108:inrequire' from /Users/username/Desktop/my-website/config/application.rb:7:in <top (required)>' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:inrequire' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:133:in block in perform' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:intap' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/commands/server/server_command.rb:130:in perform' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/command.rb:27:inrun' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in invoke_command' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/thor-0.20.0/lib/thor.rb:387:indispatch' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/command/base.rb:63:in perform' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/command.rb:44:ininvoke' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/railties-5.1.4/lib/rails/commands.rb:16:in <top (required)>' from /Users/username/Desktop/my-website/bin/rails:9:inrequire' from /Users/username/Desktop/my-website/bin/rails:9:in <top (required)>' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:inload' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in call' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:incall' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/client.rb:30:in run' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/bin/spring:49:in' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in load' from /Users/username/.rvm/rubies/ruby-2.4.1-installruby/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in' from /Users/username/Desktop/my-website/bin/spring:15:in require' from /Users/username/Desktop/my-website/bin/spring:15:in' from bin/rails:3:in load' from bin/rails:3:in'`

Aucun commentaire:

Enregistrer un commentaire