当我运行服务器时,我收到了这个错误:
Agro:homeland Zhulin$ rails s
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from <top (required)> at /Users/Zhulin/Desktop/RailsApps/homeland/config/application.rb:9)
/usr/local/lib/ruby/1.9.1/syck.rb:145:in `initialize': No such file or directory - /Users/Zhulin/Desktop/RailsApps/homeland/config/config.yml (Errno::ENOENT)
from /usr/local/lib/ruby/1.9.1/syck.rb:145:in `open'
from /usr/local/lib/ruby/1.9.1/syck.rb:145:in `load_file'
from /Users/Zhulin/Desktop/RailsApps/homeland/config/application.rb:48:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:28:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:28:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:27:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.0.0/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
我该怎么办? BTW哪里可以找到更简单的Rails代码来学习Ruby和Rails, 感谢
答案 0 :(得分:5)
您需要在config.yml
文件夹中设置config
文件。看起来repo包含一个config.yml.default
文件,您可以将其用作模板。
答案 1 :(得分:1)
由于某种原因,您似乎错过了数据库配置文件config/database.yml
。这些是由rails new <appname>
自动生成的,因此很容易获得替换。
至于例子,一本好的参考书总是最好的。我喜欢Agile Web Development with Rails书,但还有很多其他书。