簡體   English   中英

使用ActionCable將Rails應用程序部署到Heroku

[英]Deploy rails app with ActionCable to Heroku

我使用ROR和ActionCable創建了簡單的在線聊天。 然后嘗試將應用程序部署到heroku。

但是部署和應用程序無法運行后,我遇到了一個奇怪的錯誤。

Heroku構建日志:

   .........
   Bundle completed (0.70s)
   Cleaning up the bundler cache.
   Could not detect rake tasks
   ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
   and using the production group of your Gemfile.
   rake aborted!
   TypeError: nil is not a symbol
   /tmp/build_5cc20a589923a15d8ef20f9d30e7babf/kokosko-chat-c869529/vendor/bundle/ruby/2.0.0/bundler/gems/actioncable-98855fea634a/lib/action_cable.rb:29:in `module_function'
   /tmp/build_5cc20a589923a15d8ef20f9d30e7babf/kokosko-chat-c869529/vendor/bundle/ruby/2.0.0/bundler/gems/actioncable-98855fea634a/lib/action_cable.rb:29:in `<module:ActionCable>'
   /tmp/build_5cc20a589923a15d8ef20f9d30e7babf/kokosko-chat-c869529/vendor/bundle/ruby/2.0.0/bundler/gems/actioncable-98855fea634a/lib/action_cable.rb:22:in `<top (required)>'
   .........

來自github的action_cable.rb:

  # Singleton instance of the server
  module_function def server       #line #29
    @server ||= ActionCable::Server::Base.new
  end

的Gemfile

gem 'actioncable', github: 'rails/actioncable'

在本地計算機上一切正常。 有任何想法嗎?

來源,如果有幫助的話: https : //github.com/kokosko/chat/

聽起來您運行的是ruby 2.0或更低版本。 Rails 5.0需要ruby 2.2。

此錯誤消息的確切原因是在先前版本的ruby中

def foo
end

返回nil,而從ruby 2.1開始,它將返回:foo 您發布的代碼取決於此更改。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM