我有一个我在Heroku上构建的rails应用程序,我已将其配置为在那里使用SSL.现在我转向AWS EC2,我想让我的应用程序版本在没有SSL的情况下运行.完成后,我将在稍后添加SSL功能.
我的堆栈是Puma + Nginx + PostgreSQL,我正在使用Rails 4.2.4,Ruby 2.2.3和Capistrano 3.4.0.
我记得在我的应用程序中,我曾经插入过该行
config.force_ssl = true
Run Code Online (Sandbox Code Playgroud)
在config/environments/production.rb中.我评论了这一点,希望我的应用程序能够重新使用http.但事实并非如此:即使在评论该行后,每当我访问我的EC2公共IP(52.35.82.113)时,请求都会在端口80(http)上发送,并被重定向到端口443(https).
当我curl -v http://localhost在我的EC2实例上运行它返回时,可以更清楚地看到这一点:
* Rebuilt URL to: http://localhost/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost
> Accept: */*
>
< HTTP/1.1 301 Moved Permanently
* Server nginx/1.4.6 (Ubuntu) is not blacklisted
< Server: nginx/1.4.6 (Ubuntu)
< Date: Sat, 12 Dec 2015 …Run Code Online (Sandbox Code Playgroud) 我有以下coffeescript,除了这样的事实,即当图像需要一段时间加载它运行之前运行图像,然后没有所需的效果:
ready = ->
jQuery ->
$('.box').find('img').each ->
imgClass = if @width / @height > 1 then 'wide' else 'tall'
$(this).addClass imgClass
return
return
$(document).ready(ready)
$(document).on('page:load', ready)
Run Code Online (Sandbox Code Playgroud)
如何在加载整个窗口后才能运行我的功能?
到目前为止我的最佳尝试看起来像
window.onload = ->
$('.box').find('img').each ->
imgClass = if @width / @height > 1 then 'wide' else 'tall'
$(this).addClass imgClass
return
return
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我也尝试了其他几种可能性,但我无法弄清楚什么是错的.
我的问题与此不同,因为我不想等到所有的咖啡因都已完成加载,我想等到我的网页中的所有图片都已加载.
所以,这显然应该非常简单,但却无法在网上找到任何好的答案.
我有一个外置的USB硬盘驱动器.
我想用bash卸载它.(基本上我只是在寻找等效的bash命令来右键单击nautilus中的外部硬盘并选择"unmount")
我怎样才能做到这一点?
出于各种原因,执行某个绘图的最简单方法似乎是将我需要的列号存储在变量中,然后执行调用该变量的绘图命令。
这甚至可能吗?
我想实现以下目标:
plot '< paste '.filesString.'' u 1:(columnsString)
Run Code Online (Sandbox Code Playgroud)
此外,变量“columnsString”将具有类似的值
(\$2*\$5+\$(6*2-4)*\$(6*2-1))
Run Code Online (Sandbox Code Playgroud)
例如,因此它需要能够评估字符串中的所有 (6*2-4) 样式总和。我想强调的是,这个问题仅与“columnsString”的评估有关,“filesString”变量工作正常。我该如何管理?
我看不出我的代码有什么问题.抛出似乎是一个奇怪的错误.请参阅此处了解"try coffeescript"编译器中的代码.
jQuery ->
$('#swipes').sortable
axis: 'y'
update: ->
$.post( $(this).data('update-url'), $(this).sortable.('serialize') )
Run Code Online (Sandbox Code Playgroud)
错误如下:
Error on line 5: unexpected (
Run Code Online (Sandbox Code Playgroud)