• #4楼 @saiga 谢谢!我去了解一下你说的方法。

    #5楼 @huacnlee 十分感谢,我的问题已经解决了,其实原因很愚蠢。由于我是把upyun的配置放在ENV变量里的: carrierwave.rb

    CarrierWave.configure do |config|
      config.storage = :upyun
      config.upyun_username = ENV['UPYUN_USER']
      config.upyun_password = ENV['UPYUN_PASS']
      config.upyun_bucket = ENV['UPYUN_BUCKET']
      config.upyun_bucket_domain = ENV['UPYUN_DOMAIN']
    end
    

    而EVN变量的配置我并没有直接配置在shell的环境变量中,而是配置在自定义文件 local_env.yml 中,然后在 application.rb 中将该文件的配置放入 ENV 里。 因为之前upyun上传都能正常工作,所以我下意识认为这部分都是没有问题的,但是经过仔细检查之后,发现这中间确实出了问题,而且是很低级的错误,不知道是什么时候引入的。

    十分惭愧,自己没有仔细检查就来寻求帮助,看来遇到问题不能相信“下意识”,还是要一个个环节检查过去才行。总之再次感谢两位!

  • #1楼 @saiga 感谢回复!

    正如我前面描述的,操作员和密码,以及空间名,都是可以确认没有错误的,而且在升级到 Rails 4.1.0 之前都是正常工作的。

    而 carrierwave-upyun 并不会打印 restclient 的相关日志,所以也看不到 upyun 返回的的详细信息。由于接触 Ruby on Rails 刚开始没多久,我现在能想到的办法就是通过网络抓包来看看,如果有其他更好的办法请指点一下我。谢谢!

  • 我 git push 到 heroku 一直都没问题,但是 heroku run rake db:migrate 就超时,修改了 ~/.ssh/config 也不行,请教有什么解决办法?谢谢!

    $ heroku run rake db:migrate
    Running `rake db:migrate` attached to terminal... up, run.8070
     !    Heroku client internal error.
     !    Search for help at: https://help.heroku.com
     !    Or report a bug at: https://github.com/heroku/heroku/issues/new
    
        Error:       Operation timed out - connect(2) (Errno::ETIMEDOUT)
        Backtrace:   /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/client/rendezvous.rb:40:in `initialize'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/client/rendezvous.rb:40:in `open'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/client/rendezvous.rb:40:in `block in start'
                     /usr/local/rvm/rubies/ruby-1.9.3-p484/lib/ruby/1.9.1/timeout.rb:69:in `timeout'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/client/rendezvous.rb:31:in `start'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/command/run.rb:132:in `rendezvous_session'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/command/run.rb:119:in `run_attached'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/command/run.rb:24:in `index'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/command.rb:218:in `run'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/lib/heroku/cli.rb:28:in `start'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/gems/heroku-3.2.1/bin/heroku:17:in `<top (required)>'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/bin/heroku:19:in `load'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/bin/heroku:19:in `<main>'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/bin/ruby_executable_hooks:15:in `eval'
                     /usr/local/rvm/gems/ruby-1.9.3-p484@railsDemo/bin/ruby_executable_hooks:15:in `<main>'
    
        Command:     heroku run rake db:migrate
        Version:     heroku-gem/3.2.1 (x86_64-darwin12.5.0) ruby/1.9.3