Tag: amazon web services

使用Heroku在Cloudfront上提供字体

我正按照以下说明尝试在Heroku上使用Cloudfront进行设置: https ://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn-with-rails Cloudfront正在为css和js资产提供服务,但我无法获得要提供的字体图标。 我在资源/字体中有我的图标字体,我在样式表中加载字体,如下所示: @font-face { src: font-url(‘dripicons.eot’); … } Cloudfronturl没有为完整的Cloudfronturl添加前缀(它缺少子网域)。 它看起来像这样: https://.cloudfront.net/assets/dripicons-9b4649c1936652d1c1c1d18410b16ebd.eot 我尝试使用font_assets gem( https://github.com/rubymaverick/font_assets ),但它没有解决问题。 我正在使用Rails 3.2.13。 我真的很感激任何意见。 谢谢!

与Amazon S3和Cloudfront的CORS

我在Heroku上托管了一个Rails应用程序,它使用CloudFront和S3上托管的资产。 它完美地显示资产(虽然它需要一些摔跤)。 我对Cloudfront的设置: Forward Headers: Whitelist Whitelist Headers: Origin Forward Query Strings: No S3存储桶的CORS设置: * GET HEAD * 调用图像的JS(咖啡) @mousemove (e) -> ctx = $(“”).attr( width: @width height: @height )[0].getContext(“2d”) ctx.drawImage(this, 0, 0, @width, @height) # This is because firefox doesn’t support offset[X|Y] if(e.offsetX == undefined) xpos = e.pageX – $(this).offset().left; ypos = e.pageY – […]

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 Elastic Beanstalk连接超时 – 美洲狮服务器

我搜索过网络和stackoverflow,但无法做到这一点。 我有一个rails应用程序并部署到弹性beanstalk。 健康状况良好且绿色,但url不起作用。 它等了一会儿,页面说连接超时了。 当我输入eb open出错; ERROR: OSError :: [Errno 10] No child processes 无法弄清楚为什么会这样。 当我eb deploy INFO: Environment update is starting. INFO: Deploying new version to instance(s). INFO: Environment health has transitioned from Ok to Info. Application update in progress on 1 instance. 0 out of 1 instance completed (running for 4 seconds). INFO: […]

Rails app不会在弹性beanstalk aws上加载资源

对于上下文,我基本上遵循本指南来设置我的rails应用程序: https : //medium.com/@jatescher/how-to-set-up-a-rails-4-2-app-on-aws-with -elastic-豆茎,和PostgreSQL相关3f9f29c046e2 我的应用程序现在在AWS上运行: http : //ems-heroes-dev.elasticbeanstalk.com/ 运行Ruby 2.2的64位Amazon Linux 2015.03 v2.0.1(Puma) 但是,我无法加载任何资产。 这是我的config / environments / production.rb: EmsHeroes::Application.configure do config.cache_classes = true config.eager_load = true config.consider_all_requests_local = false config.action_controller.perform_caching = true config.serve_static_assets = true # Compress JavaScripts and CSS. config.assets.js_compressor = :uglifier config.assets.compress = true config.assets.compile = true # Bower asset paths […]

Rails 4,Carrierwave-aws,图像在本地上传到amazon s3但未投放到生产中(Openshift)

我在openshift上托管了一个Rails 4应用程序。 我正在使用carrierwave和carrierwave-aws gem处理图像上传。 当我在本地测试时,图像会按预期上传并显示给Amazon S3。 但是,在Openshift上托管的生产服务器上,图像将上传到“/ uploads / images”而不是亚马逊。 这是我的配置和Gemfile: gem ‘carrierwave’ gem ‘carrierwave-aws’ 在initializers / carrierwave.rb中 #config/initializers/carrierwave.rb CarrierWave.configure do |config| config.storage = :aws config.aws_bucket = ‘mybucketname’ config.aws_acl = :public_read config.asset_host = ‘https://mybucketname.s3-us-west-1.amazonaws.com’ config.aws_authenticated_url_expiration = 60 * 60 * 24 * 365 config.aws_credentials = { # Configuration for Amazon S3 :provider => ‘AWS’, :access_key_id […]

回形针上的Paperclip AWS :: S3 :: Errors :: NoSuchKey错误

我正在尝试将不同模型的头像复制到我的User模型中,但是当我尝试这样做时,我收到了AWS::S3::Errors::NoSuchKey错误。 这是抛出错误的代码: old_avatar = OldAvatar.find(1) user = User.find(old_avatar.user_id) user.avatar = old_avatar.avatar user.save user.avatar = old_avatar.avatar行是抛出它的原因。 这是我的OldAvatar模型…… has_attached_file :avatar, :styles => { :t => ’20×20#’, :s => ’40×40#’, :m => ’50×50#’, :b => ’80×80#’, :f => ‘100×100#’ }, :storage => :s3, :s3_credentials => { :access_key_id => APP_CONFIG[‘s3_access_key_id’], :secret_access_key => APP_CONFIG[‘s3_secret_access_key’] }, :path => “:attachment/:id/:basename:normalized_style.:extension”, :url => […]

如何在Elastic Beanstalk上设置delayed_job时修复’require’错误

我无法在Elastic Beanstalk上运行delayed_jobs。 我正在使用运行Ruby 2.1(乘客独立)容器的64位Amazon Linux 2014.03 v1.0.0 。 这是我的配置脚本(delayed_job.config)…… files: “/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_delayed_job.sh”: mode: “000755” owner: root group: root encoding: plain content: | #!/usr/bin/env bash . /opt/elasticbeanstalk/support/envvars cd $EB_CONFIG_APP_CURRENT su -c “RAILS_ENV=production bin/delayed_job –pid-dir=$EB_CONFIG_APP_SUPPORT/pids restart” $EB_CONFIG_APP_USER 99_restart_delayed_job.sh脚本存在并运行……但后来我99_restart_delayed_job.sh了这个错误。 2014-10-02 15:28:32,332 [INFO] (17387 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] Script succeeded. 2014-10-02 15:28:32,402 [INFO] (17448 MainThread) [directoryHooksExecutor.py-29] [root directoryHooksExecutor info] […]

Nokogiri安装在Elastic Beanstalk上失败

我试图用AWS Elastic Beanstalk部署我的Rails应用程序。 我已经创建了实例,但是当我尝试使用aws.push部署应用程序时,我在事件日志中遇到以下错误: 2014-09-22 01:23:40 UTC+0550 ERROR [Instance: i-744edb4a Module: AWSEBAutoScalingGroup ConfigSet: null] Command failed on instance. Return code: 1 Output: Error occurred during build: Command hooks failed . 2014-09-22 01:23:39 UTC+0550 ERROR Script /opt/elasticbeanstalk/hooks/appdeploy/pre/10_bundle_install.sh failed with returncode 5 我拉了日志,发现nokogiri gem的安装失败并出现错误: ————————————- /var/log/directory-hooks-executor.log ————————————- Using mail 2.5.4 Using actionmailer 4.0.2 Using active_utils 2.2.1 Using […]

Mysql无法通过Amazon EC2上的套接字连接到本地服务器

我在Amazon EC2上打开了我的应用程序(在Rails中)并收到错误 – 因此我检查了日志并且有以下内容: ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (111) 10个小时前,一切正常。 有什么问题? 很多交通? 该应用程序正在Micro Instance上运行。 如何解决这个问题以及将来如何避免这个问题? 非常感谢你 编辑: sudo find / -type s — /tmp/.sock /dev/log /var/lib/apt-xapian-index/update-socket /run/mysqld/mysqld.sock /run/acpid.socket /run/dbus/system_bus_socket /run/udev/control find: `/proc/4739/task/4739/fd/5′: No such file or directory find: `/proc/4739/task/4739/fdinfo/5′: No such file or directory find: `/proc/4739/fd/5′: No […]