简体   繁体   English

rake db:migrate获取错误

[英]rake db:migrate gets error

I have just recently cloned a sample rails application I am working on onto my macbook and I am trying to run rake db:migrate but I get the following error 我刚刚克隆了一个示例rails应用程序,我正在研究我的macbook,我正在尝试运行rake db:migrate但是我收到以下错误

rake aborted!
/Users/anderskitson/Sites/sample_app/db/migrate/20130207032207_add_password_digest_to_users.rb:5: syntax error, unexpected keyword_end, expecting $end

Here is the rb file 这是rb文件

raclass AddPasswordDigestToUsers < ActiveRecord::Migration
  def change
    add_column :users, :password_digest, :string
  end
end

You have a typo in the first line, first word (raClass). 你在第一行有一个拼写错误,第一个单词(raClass)。 It should be: 它应该是:

 Class AddPasswordDigestToUsers < ActiveRecord::Migration
      def change
        add_column :users, :password_digest, :string
      end
    end

尝试使用“class”而不是“Class”......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM