- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我在我的 Rails 应用程序中使用 Redis 缓存:
config.cache_store = :redis_store, redis_url
当我将我的 Rails 应用程序直接推送到 Heroku 时,它已成功部署。使用 Travis 时,Heroku 部署步骤失败,因为 Assets 预编译尝试连接到 Redis。
Running: rake assets:precompile
rake aborted!
ArgumentError: invalid uri scheme ''
/tmp/build_7c5f167bf750cb2986dbb9c3510ea11e/vendor/bundle/ruby/2.1.0/gems/redis-3.2.0/lib/redis/client.rb:390:in `_parse_options'
我尝试过各种方法:使用 rake 任务重写 RedisStore 方法,将 cache_store 实例化移动到初始化阶段,使用 Docker 代替 sudo,更改 Heroku 构建策略和其他 travis.yml 配置等。
我不想在本地预编译,也不想更改缓存解决方案。在 cedar-14 堆栈上运行的许多其他应用程序使用非常相似的设置,因此这个问题看起来有点奇怪。
有什么解决 Travis+Heroku 部署问题的建议吗?
最佳答案
在我的例子中,我通过将 redis init 更改为:
REDIS = Redis.new(:url => redis_url_string)
之前我解析 URI 并将参数传递为:
uri = URI.parse(redis_url)
REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password, :scheme => uri.scheme)
我想知道cache store init是否有类似redis的init实现(我没查过那里的源)。
关于ruby-on-rails - 为什么 Travis 在部署到 Heroku 时无法连接使用 Redis cache_store?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28067644/
我正在尝试使用 redis-store作为我的 Rails 3 cache_store。我还有一个 initializer/app_config.rb,它加载一个用于配置设置的 yaml 文件。在我的
我的应用程序有一项功能,允许管理员通过 GUI 更改 cache_store 配置。然后新的配置会立即生效。 我的 production.rb 中的默认 cache_store: config.cac
我正在尝试在environments/development.rb中使用类似的内容配置Rails 3 cache_store: config.cache_store = :memory_store,
我正在尝试在开发模式下开发带有缓存的应用程序,但垃圾邮件中的 development.log 主要由缓存日志组成。我用的是 dalli,我知道,dalli 有静音!方法(https://github.
我已将 Rails 设置为使用 redis 作为其缓存存储: config.cache_store = :redis_store 但是,我在与生产环境相同的服务器上有一个暂存环境,它们都使用相同的 r
我已经完成了我的谷歌尽职调查,但找不到明确的答案。所以,堆栈溢出的好人...... 如果在 rails 3 应用程序中,我没有使用 cookie 来存储 session ,那么安全地管理“Applic
我在我的 Rails 应用程序中使用 Redis 缓存: config.cache_store = :redis_store, redis_url 当我将我的 Rails 应用程序直接推送到 Hero
我正在使用 Rails 的缓存。我的更改是按以下顺序在 development.rb 中进行的: config.cache_store = :file_store, "#{Rails.root}/tm
我是一名优秀的程序员,十分优秀!