小编mon*_*cht的帖子

如何通过capistrano进入生产轨道控制台?

我想通过capistrano从我的本地机器进入生产服务器上的rails控制台.我找到了一些要点,例如https://gist.github.com/813291,当我进入控制台时

cap production console 
Run Code Online (Sandbox Code Playgroud)

我得到以下结果

192-168-0-100:foldername username $ cap console RAILS_ENV=production
  * executing `console'
  * executing "cd /var/www/myapp/current && rails console production"
    servers: ["www.example.de"]
    [www.example.de] executing command
    [www.example.de] rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.3' -c 'cd /var/www/myapp/current && rails console production'
/var/www/myapp/releases/20120305102218/app/controllers/users_controller.rb:3: warning: already initialized constant VERIFY_PEER
Loading production environment (Rails 3.2.1)
Switch to inspect mode.
Run Code Online (Sandbox Code Playgroud)

这就是它...现在我可以输入一些文字,但没有任何反应......

有谁知道如何获得该工作或我的问题的另一种解决方案?

console capistrano ruby-on-rails

20
推荐指数
3
解决办法
1万
查看次数

即使状态代码是400,如何从curl请求输出到文件?

如果我通过curl向普通网站发出请求,我可以将输出定向到带有标题数据的文件,如下所示:

命令:

curl -is www.google.de > temp.txt
Run Code Online (Sandbox Code Playgroud)

输出:

HTTP/1.1 200 OK
Date: Wed, 29 Feb 2012 16:49:09 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
Set-Cookie: PREF=ID=16ad7441d475580e:FF=0:TM=1330534149:LM=1330534149:S=2MpGe04BWQ8Kn3P7; expires=Fri, 28-Feb-2014 16:49:09 GMT; path=/; domain=.google.de
Set-Cookie: NID=57=BCgUcqNQU5dMWcBEMP85saDNUdXg2_LG4eZFmS-yr1W38UyTNuB8BU8iiOOsK2747WGJG99uJDW6t8N78D4QzBma7q2EmKQ69-gCjOysFNLGFggrvMxcqEOl7p1hemeQ; expires=Thu, 30-Aug-2012 16:49:09 GMT; path=/; domain=.google.de; HttpOnly
P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Transfer-Encoding: chunked

<!doctype html><html itemscope itemtype="http://schema.org/WebPage"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><meta itemprop="image" content="/images/google_favicon_128.png"><title>Google</title><script>window.google={kEI:"BVdOT7OzE8_ktQaqk-WGDw",getEI:function(a){var d;while(a&&!(a.getAttribute&&(d=a.getAttribute("eid"))))a=a.parentNode;return d||google.kEI},https:function(){return window.location.protocol=="https:"},kEXPI:"31701,33551,34324,34904,35055,35091,36604,36683,36716,36946,37017,37055,37126",kCSI:{e:"31701,33551,34324,34904,35055,35091,36604,36683,36716,36946,37017,37055,37126",ei:"BVdOT7OzE8_ktQaqk-WGDw"},authuser:0,
ml:function(){},kHL:"de",time:function(){return(new Date).getTime()},log:function(a,d,f,h){var e=new Image,g=google,k=g.lc,i=g.li,m="";e.onerror=(e.onload=(e.onabort=function(){delete …
Run Code Online (Sandbox Code Playgroud)

bash shell curl

7
推荐指数
1
解决办法
3万
查看次数

在XCode中编译IOS应用程序时出现错误"找不到文件:-fobjc-arc"

添加OCMock框架后我得到了那个奇怪的错误...... :(

ld: file not found: -fobjc-arc
clang: error: linker command failed with exit code 1 (use -v to see invocation)

看起来编译器标志是否试图由XCode加载?

任何的想法?

最好的问候,hijolan

xcode linker objective-c

7
推荐指数
1
解决办法
4283
查看次数

如何在Objective-C内联中声明好的旧C-Array?

这是我的一段代码:

NSUInteger indexArr[] = {1,2,3,4};

NSIndexSet *indexSet = [NSIndexPath indexPathWithIndexes:indexArr length:4];
Run Code Online (Sandbox Code Playgroud)

有没有办法声明indexArr内联,比如

NSIndexSet *indexSet = [NSIndexPath indexPathWithIndexes:{1,2,3,4} length:4];
Run Code Online (Sandbox Code Playgroud)

或者其他的东西?这是因为我正在编写带有一些参考路径的测试,我想保存对任何人都没用的代码行......

最好的问候,hijolen

arrays objective-c

5
推荐指数
1
解决办法
1034
查看次数

使用XML-Views时如何在SAPUI5中实现DataBinding?

在使用JS-Views时,在SAPUI5中为表或某事物分配模型或数据绑定非常容易.但是,在使用XML-Views时,我该怎么做呢?

<?xml version="1.0" encoding="UTF-8" ?>
<core:View
    xmlns:core="sap.ui.core"
    xmlns="sap.ui.commons"
    xmlns:table="sap.ui.table"
    xmlns:html="http://www.w3.org/1999/xhtml"
    controllerName="view.Main">
    <Panel text="Hello World from an XML view">
        <Button text="Button" press="doSomething"></Button>
        <table:Table width="100%" visibleRowCount="5" selectionMode="Single" editable="false">
            <table:title><Label text="Wochentage"></Label></table:title>
            <table:Column>
                <Label text="ID" />
                <table:template><TextField value="{id}"></TextField></table:template>
            </table:Column>

        </table:Table>
    </Panel>
</core:View>
Run Code Online (Sandbox Code Playgroud)

我不想给表一个修复id属性并通过调用实现它

sap.ui.getCore().getElementById("idProductsTable").setModel(

            demoJSONModel);
Run Code Online (Sandbox Code Playgroud)

在控制器...... :(

javascript xml sapui5

2
推荐指数
1
解决办法
2万
查看次数