0

我用*rails new {project_name} -d mysql*创建了一个 rails 站点

然后 cd 到 project_name 并运行rails server命令,但出现以下错误,可能是什么问题?有谁知道?我必须更改模式 040777 吗?如果是,如何?谢谢

/Library/Ruby/Gems/1.8/gems/railties-3.2.13/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:216: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib (LoadError)
  Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
  Reason: image not found - /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle
    from /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2.rb:9
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in `require'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.3.5/lib/bundler.rb:132:in `require'
    from /Users/henryjoseph/Sites/simple_cms/config/application.rb:7
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.13/lib/rails/commands.rb:53
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
    from /Library/Ruby/Gems/1.8/gems/railties-3.2.13/lib/rails/commands.rb:50
    from script/rails:6:in `require'
    from script/rails:6
4

1 回答 1

1
cd ur_dir

然后你必须将你的 mysql 数据库连接到你的项目。为此,您会看到 config/database.yml 文件,您必须在其中添加它

development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: your_database_name
  pool: 5
  username: your_db_username
  password: ur_db_password
  host: localhost

然后是轨道

于 2013-04-09T09:16:48.613 回答