我在 rails、postgres 上安装了 ruby.我安装了所有必需的 gem 文件,我创建了一个项目 guides.rubyonrails/getting_started.html 想要>
我在 config/routes.rb 中添加了以下代码
Blog::Application.routes.draw 做资源:帖子根到:欢迎#index"结尾我正在尝试运行 rake routes 命令.
但是我明白了
rake 中止!未找到 Rakefile(查找:rakefile、Rakefile、rakefile.rb、Rakefile.rb)我检查了互联网.每个人都说我需要在确切的项目文件夹下运行它".但我需要说的是,我在 Windows 7 上尝试了近 20 个不同的文件夹.(我快疯了)
我不完全知道您的专家需要什么,但是:
我使用:
Windows 7 Ultimate(64 位)Ruby200-x64rake-10.1.0
提前致谢..
解决方案听起来您的 Rakefile 可能丢失了,或者您可能不在应用的根目录"中.
cd 到你的博客目录,你应该看到,
$ ls应用程序/仓/配置/D b/...如果它不存在,则创建一个名为 Rakefile 的新文件并将此文本放入其中.
#!/usr/bin/env rake# 在 lib/tasks 中以 .rake 结尾的文件中添加您自己的任务,# 例如 lib/tasks/capistrano.rake,它们将自动对 Rake 可用.需要 File.expand_path('../config/application', __FILE__)博客::Application.load_tasksI installed ruby on rails, postgres. I installed all required gem files, I created a project as guides.rubyonrails/getting_started.html wants
I added below code in config/routes.rb
Blog::Application.routes.draw do resources :posts root to: "welcome#index" endI am trying to run rake routes command.
But i get
rake aborted! No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)I checked internet.. Everybody says "i need to run it under exact project folder". But i need to say, I tried almost 20 different folders on my Windows 7. (I am getting crazy)
I don't exactly know what is necessary for you experts, but :
I use :
Windows 7 Ultimate (64bit) Ruby200-x64 rake-10.1.0
Thanks in advance..
解决方案Sounds like your Rakefile might be missing, or you might not be in the app's "root directory".
cd to your blog directory, and you should see,
$ ls app/ bin/ config/ db/ ...If it doesn't exist already, create a new file named Rakefile and put this text in there.
#!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. require File.expand_path('../config/application', __FILE__) Blog::Application.load_tasks
更多推荐
Ruby on Rails,未找到 Rakefile 错误
发布评论