小编Egg*_*Six的帖子

NameError(未初始化的常量Paperclip :: Storage :: S3 :: AWS):

我正在尝试将图像合并到我的网络应用程序中,并在删除了一些功能后继续遇到此错误.它归结为我的"创建"应用程序控制器,我不完全确定我应该从哪里开始.

2015-02-06T20:30:12.292187+00:00 app[web.1]:    (1.9ms)  ROLLBACK
2015-02-06T20:30:12.296299+00:00 app[web.1]: NameError (uninitialized constant Paperclip::Storage::S3::AWS):
2015-02-06T20:30:12.296301+00:00 app[web.1]:   app/controllers/articles_controller.rb:24:in `create'
2015-02-06T20:45:14.691084+00:00 app[web.1]: [paperclip] saving /articles/images/000/000/013/original/git.jpeg
2015-02-06T20:45:14.698744+00:00 app[web.1]: Completed 500 Internal Server Error in 584ms
2015-02-06T20:45:14.700871+00:00 heroku[router]: at=info method=POST path="/articles" host=preston.herokuapp.com request_id=d9d02257-3616-4686-bce5-3d912cd528c2 fwd="76.22.102.38" dyno=web.1 connect=1ms service=698ms status=500 bytes=1754
Run Code Online (Sandbox Code Playgroud)

Articles_controller.rb

class ArticlesController < ApplicationController
http_basic_authenticate_with name: "name", password: "password", except: [:index, :show]

    def index
        @articles = Article.all.order("created_at DESC")
    end

    def show
        @article = Article.find(params[:id])
    end

    def new
        @article = Article.new
    end 

    def edit
        @article = Article.find(params[:id])

    end …
Run Code Online (Sandbox Code Playgroud)

ruby ruby-on-rails paperclip amazon-web-services

90
推荐指数
2
解决办法
3万
查看次数

如何将两个零00作为整数打印?

我正在研究一些应用学院的练习题,我似乎无法打印两个00的时间转换.这是我到目前为止所拥有的:

def time_conversion(minutes)
  hours = minutes/60            
  if minutes%60 < 10
    minutes = minutes%60
  elsif minutes%60 > 10
    minutes = minutes%60
  elsif minutes%60 == 0
    minutes = 00
  end        

  return "#{hours}:#{minutes}"
end

time_conversion(360)
Run Code Online (Sandbox Code Playgroud)

ruby string

4
推荐指数
1
解决办法
174
查看次数