开发者

uninitialized constant Base64

开发者 https://www.devze.com 2023-03-10 10:25 出处:网络
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 Ke
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

精彩评论

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