1
MySQL的似乎是工作 - 我可以耙分貝:創建給NoMethodError:未定義的方法`初始化」爲Rails:模塊
$ mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.6.27 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
但是在Rails項目中,我們已經使用了好一會兒:
$ rake db:create
14:47:41 mdurrant EQ-267 /Users/mdurrant/eq/lynx master
$ rake db:migrate
rake aborted!
NoMethodError: undefined method `init' for Rails:Module
/Users/mdurrant/eq/lynx/config/initializers/configatron.rb:2:in `<top (required)>'
/Users/mdurrant/.rvm/gems/ruby-2.1.5/gems/railties-3.2.22/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
/Users/mdurrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/Users/mdurrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
...
$ ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
14:50:33 mdurrant EQ-267 /Users/mdurrant/eq/lynx master
$
$ cat config/initializers/configatron.rb
require 'configatron'
Configatron::Rails.init
'configatron.rb'中的代碼是什麼? –
在問題 –
中添加了這個信息你確定'Configtron :: Rails'中的_module_級別定義了'init'方法嗎? – linkyndy