Heroku ArgumentError:无效的网址。也许与Redis不兼容?

时间:2014-12-08 20:39:14

标签: ruby-on-rails heroku deployment redis production

当我尝试将我的代码推送到Heroku时,似乎我在下面列出了一个参数错误。查看ArgumentError行之后的前几条消息,我假设它是因为我有redis gem。由于我不知道发生了什么,我做错了什么?

.....

remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        ArgumentError: invalid url
remote:        /tmp/build_5520123e0f01ae60332802520d05d1b7/vendor/bundle/ruby/2.0.0/gems/redis-3.0.7/lib/redis/client.rb:350:in `_parse_options'

......

我的GemFile仅供参考

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

gem "bcrypt", "3.1.7"
gem "faker", "1.4.2"
gem 'bootstrap-sass', '3.2.0.0'
gem 'backstretch-rails', '~>2.0.4'
gem "font-awesome-rails"
gem 'redis', '~> 3.0.1'
gem 'hiredis', '~> 0.4.5'
gem 'braintree', '~> 2.33.1'
gem 'figaro', '~> 0.7.0'
gem 'gon', '~> 5.1.2'


gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc


gem 'spring',        group: :development

group :development do
  gem "better_errors"
end

group :production do
    gem 'unicorn', '4.8.3'
    gem 'rails_12factor', '0.0.2'
end

2 个答案:

答案 0 :(得分:10)

REDIS消息有点red herring

确保为heroku正确设置了.git/config

类似的东西:

  

[remote“heroku”]

     

url = git@heroku.com:my-awesome-project.git

而不是:

  

[remote“heroku”]

     

url = https://heroku.com/my-awesome-project.git

后者将启动您的部署,一切看起来都正确,但编译将失败。

答案 1 :(得分:1)

在通过HTTP传输使用Git时,这是构建管道的错误。

我今天推出了一个解决方案。给您带来的任何不便,我深表歉意。