Tag: heroku

通过纱线安装bootstrap的Rails无法找到字体

我有一个带有Bootstrap的Rails 5应用程序,我安装了纱线。 我做了以下事情: yarn add bootstrap bootstrap@^3.3.7: version “3.3.7” resolved “https://registry.yarnpkg.com/bootstrap/-/bootstrap-3.3.7.tgz#5a389394549f23330875a3b150656574f8a9eb71” 在application.css上 *= require bootstrap/dist/css/bootstrap 在application.js上 //= require bootstrap/dist/js/bootstrap //= require rails-ujs //= require @fnando/sparkline/dist/sparkline //= require_tree . 在assets.rb上 Rails.application.config.assets.paths << Rails.root.join('node_modules') Rails.application.config.assets.paths << Rails.root.join('node_modules/bootstrap/dist/fonts') Rails.application.config.assets.precompile << %r{node_modules/bootstrap/dist/fonts/[\w-]+\.(?:eot|svg|ttf|woff2?)$} 不过,当我在生产(Heroku)上访问它时,我得到了 ActionController::RoutingError (No route matches [GET] “/fonts/glyphicons-halflings-regular.ttf”): 我尝试添加$icon-font-path: “node_modules/bootstrap/dist/fonts”; 以及我的scss,但也没有奏效

carrierwave Excon :: Errors :: SocketError

我已经阅读了几篇与此相关的post和​​解决方案,但我仍然无法理解它仍然会返回“Excon :: Errors :: SocketError at / posts getaddrinfo:nodename也没有提供servname,或者不知道(SocketError)” 这是config / carrierwave.rb CarrierWave.configure do |config| config.fog_credentials = { :provider => ‘AWS’, # required :aws_access_key_id => ‘—-‘, # required :aws_secret_access_key => ‘—-‘, # required :region => ‘eu-west-1’, # optional, defaults to ‘us-east-1’ :host => ‘s3.example.com’, # optional, defaults to nil :endpoint => ‘https://s3.example.com:8080’ # optional, defaults […]

Errno :: ECONNREFUSED(连接被拒绝 – 连接(2)为nil端口587):对于Heroku上的Rails

我怀疑我在这里遗漏了一些基本的东西,但是在没有运气的情况下与这一个人摔跤了一段时间。 Rails 4.2.5 Ruby 2.2.3p173 电子邮件使用Amazon SES在localhost上发送正常(我遵循了这个恒星指南 ),但没有在Heroku生产环境中发送。 我收到post标题中的错误: Errno::ECONNREFUSED (Connection refused – connect(2) for nil port 587) 我怀疑问题的核心是那里的nil ,但我无法弄清楚它的来源。 没有其他人似乎有这个问题,甚至调试级别日志也没有给我任何更多的东西。 我已经阅读了几十个这样的post。 但据我所知,我的配置符合所有规格。 任何帮助/建议将不胜感激。 development.rb # Devise config.action_mailer.default_url_options = { host: ‘localhost’, port: 3000 } # Configure mailer config.action_mailer.delivery_method = :smtp config.action_mailer.perform_deliveries = true config.action_mailer.raise_delivery_errors = true config.action_mailer.default :charset => “utf-8” config.action_mailer.smtp_settings = { :address […]

Rails asset_host,cloudfront和heroku

我正在heroku上运行一个rails 4.0应用程序,对于我的生活,我无法使用我在asset_host中设置的主机获取我的资产URL。 我相信我的云端设置很好,因为我可以在我的cloudfronturl中替换我的任何资产url,并且该文件是从heroku中获取并缓存在cloudfront上的。 所以https://xxxxxxxxxxxx.cloudfront.net/assets/application-xxxxxxxx.js正确缓存https://myapp.com/assets/application-xxxxxxxxx.js 。 问题似乎是我的资产助手,例如javascript_include_tag,永远不会在staging.rb中使用asset_host设置。 我加载页面时看到的是我所有的js和css文件都来自https://myapp.com/assets/ 我的分段设置如下所示: # Full error reports are disabled and caching is turned on config.consider_all_requests_local = false config.action_controller.perform_caching = true # Disable Rails’s static asset server (Apache or nginx will already do this) config.serve_static_assets = true # Compress JavaScripts and CSS config.assets.compress = true # Don’t fallback to assets pipeline […]

Ruby on Rails资产没有在Heroku上进行预编译

我有一个在本地开发环境中工作的项目,但在上传到Heroku时会中断。 在Heroku上访问我的项目时,我注意到我收到来自服务器的404响应,说它无法找到我的css和js文件。 我做了一些搜索,发现Heroku没有预编译我的资产。 该项目将正常工作,直到Heroku让我的项目进入睡眠状态。 在Heroku中唤醒项目后, css和js被破坏了。 该项目使用的是Rails 4.2.4,我确保在我的config/application.rb包含config.serve_static_assets = true在我gem ‘rails_12factor’, group: :production production。 当Heroku由于不活动而使项目进入睡眠状态时, css和js才会中断。 有没有人知道如何让Heroku在睡眠中唤醒时自动预编译资产?

来自heroku的DB pull因Encoding :: CompatibilityError而失败

我在执行db时遇到了一些问题:从heroku回到我当地的开发环境。 我的设置是MySQL(5.1.50),通过RVM在Mac OS X Snow Leopard下的本地Rails 3 / Ruby 1.9.2环境中安装MacPorts,我已经成功执行了一个heroku db:push送到Heroku上的生产站点多次。 但是,在具有相同设置的二次开发机器上,当我尝试通过heroku db:pull Heroku数据库heroku db:pull ,我在下载表和索引信息一段时间后得到以下错误: /Users/jschuur/.rvm/gems/ruby-1.9.2-p0/gems/sequel-3.15.0/lib/sequel/adapters/shared/mysql.rb:399:in `join’: incompatible character encodings: UTF-8 and ASCII-8BIT (Encoding::CompatibilityError) from /Users/jschuur/.rvm/gems/ruby-1.9.2-p0/gems/sequel-3.15.0/lib/sequel/adapters/shared/mysql.rb:399:in `multi_insert_sql’ 这是相关的gem: ruby-mysql (2.9.3) sequel (3.15.0) mysql2 (0.2.4) taps (0.3.13) heroku (1.10.6, 1.10.5, 1.10.0) 这里有完整的错误和gem列表。 同样的错误发生在我的主要生产机器BTW(我一直在做成功的数据库:推送到heroku表单)。 现在我明白这基本上是一个UTF8编码错误。 FWIW,我的database.yml显式引用了UTF8: development: adapter: mysql2 encoding: utf8 database: rails_dev_dbname pool: 5 username: […]

试图通过heroku上的bootstrap-sass导入bootstrap但是收到错误

我有一个rails应用程序,我正在尝试使用bootstrap-sass在heroku上导入bootstrap,遵循以下指示: https : //github.com/thomas-mcdonald/bootstrap-sass 在我的application.css中,我有: @import “bootstrap”; /* * This is a manifest file that’ll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. […]

heroku PGError:已经存在500我们很抱歉,但出了点问题

求助:有些神秘地消失了这个问题,这是heroku生成的url http://pacific-escarpment-9949.herokuapp.com/ 我非常感谢,如果有人会详细说明为什么它在30分钟之前给出了一个错误页面,但现在不再这样了。 它在当地工作正常。 但当我把它推到Heroku时,就会出现这个错误。 我认为它与数据库有关,因为我使用了命令: rails generate migration add_user_id_to_post integer (pseudocode, it worked fine) 我已经运行:$ heroku运行rake db:migrate 应该是主页的页面显示:我们很抱歉,但出了点问题。 我以前遇到过这个问题但是当我运行heroku运行rake db:migrate时,它解决了这个问题。 但不是这一次。 请帮忙。 我现在已经被困3个小时了。 谢谢。 这是我在git hub上的回购: https : //github.com/nixor/blog 请原谅我的noobness,所有这些都是我新的2周。 nixor@unix:$ heroku run rake db:migrate Running `rake db:migrate` attached to terminal… up, run.1 DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for […]

Facebook登录OmniAuth错误更改被拒绝

我能够使用Omniauth http://railscasts.com/episodes/241-simple-omniauth我的Rails应用程序设置我的Facebook和Twitter登录。 我的登录工作在我的计算机上完美运行(我在生产和开发方面进行了测试),直到有人在尝试使用Facebook登录时通过电子邮件向我发送此问题时才发现问题: The change you wanted was rejected. Maybe you tried to change something you didn’t have access to. 事实certificate,在我的开发计算机上,没有其他人可以通过FB或Twitter登录或创建帐户。 从其他解决方案中,我删除了protect_from_forgery并将skip_before_filter :verify_authenticity_token添加到我的application_controller.rb,但我仍然遇到同样的问题。 我正在Heroku上托管我的应用程序。 有谁知道发生了什么? 如果您需要任何其他信息,请告诉我。

S3直接上传不上传文件

/config/intilializers/paperclip.rb Paperclip::Attachment.default_options[:storage] = :s3 Paperclip::Attachment.default_options[:bucket] = ‘xxx’ Paperclip::Attachment.default_options[:s3_permissions] = :public_read Paperclip::Attachment.default_options[:s3_credentials] = { access_key_id: ‘xxx’ ,secret_access_key: ‘xxx’} /config/intilializers/s3_direct_upload.rb S3DirectUpload.config do |c| c.access_key_id = ‘xx’ # your access key id c.secret_access_key = ‘xxx’ c.bucket = ‘xxx’ # your bucket name c.region = ‘s3-ap-southeast-1’ end AWS.config({ :access_key_id => ‘xxx’, :secret_access_key => ‘xxx’, :region => ‘ap-southeast-1’ }) Ad.rb […]