2011-07-22 47 views
1

我一直在嘗試運行rake db:migrate命令,但它不起作用。我卸載並安裝了寶石,但沒有運氣。我在某處讀到o.9不穩定,0.8.7沒問題。我嘗試過,但我得到一個錯誤也..Rails:幫助耙子中止錯誤!

對於現在的錯誤是

Fayimora-Femi-Baloguns-MacBook-Pro:sample_app fayimora$ bundle exec rake db:migrate 
    /Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure  world writable dir /usr/local in PATH, mode 040777 
/Library/Ruby/Gems/1.8/gems/bundler-1.0.15/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777 
(in /Users/fayimora/Sites/rails_projects/sample_app) 
DEPRECATION WARNING: config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead. (called from /Users/fayimora/Sites/rails_projects/sample_app/config/application.rb:12) 
DEPRECATION WARNING: config.generators in Rails::Railtie is deprecated. Please use config.app_generators instead. (called from /Users/fayimora/Sites/rails_projects/sample_app/config/application.rb:12) 
rake aborted! 
undefined method `prerequisites' for nil:NilClass 
/Users/fayimora/Sites/rails_projects/sample_app/Rakefile:7 
(See full trace by running task with --trace) 

我的創業板名單的Rakefile

#!/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 'rake/dsl_definition' 
require File.expand_path('../config/application', __FILE__) 

SampleApp::Application.load_tasks 

Fayimora-Femi-Baloguns-MacBook-Pro:sample_app fayimora$ bundle 
Using rake (0.8.7) 
Using ZenTest (4.5.0) 
Using multi_json (1.0.3) 
Using activesupport (3.1.0.rc4) 
Using bcrypt-ruby (2.1.4) 
Using builder (3.0.0) 
Using i18n (0.6.0) 
Using activemodel (3.1.0.rc4) 
Using erubis (2.7.0) 
Using rack (1.3.1) 
Using rack-cache (1.0.2) 
Using rack-mount (0.8.1) 
Using rack-test (0.6.0) 
Using hike (1.1.0) 
Using tilt (1.3.2) 
Using sprockets (2.0.0.beta.10) 
Using tzinfo (0.3.29) 
Using actionpack (3.1.0.rc4) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.3.0) 
Using actionmailer (3.1.0.rc4) 
Using arel (2.1.3) 
Using activerecord (3.1.0.rc4) 
Using activeresource (3.1.0.rc4) 
Using autotest (4.4.6) 
Using sys-uname (0.8.5) 
Using autotest-fsevent (0.2.4) 
Using autotest-growl (0.2.9) 
Using autotest-rails-pure (4.1.2) 
Using bundler (1.0.15) 
Using coffee-script-source (1.1.1) 
Using execjs (1.2.0) 
Using coffee-script (2.2.0) 
Using diff-lcs (1.1.2) 
Using rack-ssl (1.3.2) 
Using rdoc (3.8) 
Using thor (0.14.6) 
Using railties (3.1.0.rc4) 
Using jquery-rails (1.0.12) 
Using json (1.5.3) 
Using nokogiri (1.5.0) 
Using rails (3.1.0.rc4) 
Using rspec-core (2.0.0.beta.18) 
Using rspec-expectations (2.0.0.beta.18) 
Using rspec-mocks (2.0.0.beta.18) 
Using rspec (2.0.0.beta.18) 
Using webrat (0.7.3) 
Using rspec-rails (2.0.0.beta.18) 
Using sass (3.1.4) 
Using sass-rails (3.1.0.rc.4) 
Using spork (0.9.0.rc8) 
Using sqlite3 (1.3.3) 
Using uglifier (1.0.0) 

內容請任何幫助將是明顯的。一直很難學習導軌。

+0

你安裝了什麼版本的Rails? 'rails -v' –

+0

我的版本是3.1.0.rc4 – DaMainBoss

+0

你能用Rakefile的內容編輯你的文章嗎? –

回答

2

Rake 0.9.2的錯誤是固定的。嘗試使用Rake 0.9.2將其添加到您的Gemfile並運行

bundle update rake

除了試驗或檢查您的寶石的兼容性,我不會使用Rails 3.1 RC。 Rails 3.0.9相當穩定並得到廣泛支持。

編輯:https://github.com/rails/rails/issues/1197

的問題是關係到寶石不被使用Rails 3.1兼容。嘗試從您的Gemfile中刪除rspec,bundle install,並運行您的rake任務。

+0

我使用0.9.2,它不工作,這就是爲什麼我向下移動。此外,我已經走了很長的路要走的應用程序與學習,woudnt可以使用3.0.9 ..請問你只需要步驟使用0.9.2?謝謝 – DaMainBoss

+0

是否可以同時使用rake ans spec?我發現真的很難評論出我的rspec文我想遷移和取消評論我想測試 – DaMainBoss

+0

不幸的是,你可能不得不等待一個工作的rspec版本,兼容Rails 3.1 –