开发者

uninitialized constant Base64

class Key < ActiveRecord::Base

  class << self

    def generate (key)
      Base64.encode64(key)
    end
  end
end

When calling Key.generate from a controller it works as expected. However, when calling Key.generate from a Rake::Task library I receive the error message:

uninitialized con开发者_运维问答stant Base64


did you put require 'base64' inside application.rb after require 'rails/all'?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜