我正在尝试使用以下命令安装memcached:
brew install memcached
Run Code Online (Sandbox Code Playgroud)
这样做会导致自制程序无法创建符号链接:
The linking step did not complete successfully
The formula built, but is not symlinked into /usr/local
Run Code Online (Sandbox Code Playgroud)
救命!
是否可以为提交后提交期间受影响的所有文件创建补丁(差异文件)?这些文件具有相同的版本号,我需要来自其先前版本的每个文件的差异.
我的应用程序在开发环境中运行时工作正常.在production(rails server -e production
)中,浏览器无法访问css和js文件,并且在控制台上有以下消息:
I, [2013-07-27T21:00:59.105459 #11449] INFO -- : Started GET "/javascripts/application.js" for 99.102.22.124 at 2013-07-27 21:00:59 +0000
F, [2013-07-27T21:00:59.108302 #11449] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/javascripts/application.js"):
Run Code Online (Sandbox Code Playgroud)
在生产环境中来自html源头部分:
<head>
<title>a Social Server</title>
<link data-turbolinks-track="true" href="/stylesheets/application.css" media="all" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
<script data-turbolinks-track="true" src="/javascripts/application.js"></script>
<meta content="authenticity_token" name="csrf-param">
<meta content="jYM4IAXTXAuKWeD4FEVrXgXRNFeB6EazU68ZBQfRqNY=" name="csrf-token">
</head>
Run Code Online (Sandbox Code Playgroud)
另一方面,在开发环境中,头部看起来像:
<head>
<title>a Social Server</title>
<link data-turbolinks-track="true" href="/assets/application.css?body=1" media="all" rel="stylesheet">
<link data-turbolinks-track="true" href="/assets/twitter-bootstrap-static/bootstrap.css?body=1" media="all" rel="stylesheet">
<link data-turbolinks-track="true" href="/assets/twitter-bootstrap-static/fontawesome.css?body=1" media="all" rel="stylesheet">
<link data-turbolinks-track="true" href="/assets/bootstrap_and_overrides.css?body=1" media="all" …
Run Code Online (Sandbox Code Playgroud) 什么是D in
-Dproperty=value
Run Code Online (Sandbox Code Playgroud)
设置系统属性值.
在的Java应用程序启动立场?出于某种原因,它一直困扰着我,为什么D?
运行测试文件时出现以下错误.
$ruby test/test_gothonweb.rb
/Users/sony/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- rack/test (LoadError)
from /Users/sony/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from test/test_gothonweb.rb:3:in `<main>'
Run Code Online (Sandbox Code Playgroud)
测试文件的片段:
require_relative '../lib/gothonweb.rb'
require 'test/unit'
require 'rack/test'
ENV['RACK_ENV'] = 'test'
class GothonwebTest < Test::Unit::TestCase
include Rack::Test::Methods
def app
Sinatra::Application
end
end
Run Code Online (Sandbox Code Playgroud)
我认为gem已经安装并应该可用:
gem list
*** LOCAL GEMS ***
bundler (1.1.3)
rack (1.4.1)
rack-protection (1.2.0)
rake (0.9.2.2)
rubygems-bundler (0.9.0)
rvm (1.11.3.3)
sinatra (1.3.2)
tilt (1.3.3)
Run Code Online (Sandbox Code Playgroud)
为什么你会想到这个错误?
我在GitHub上创建了一个名为"messages"的存储库和一个名称相同的本地存储库.我试图将文件从我的本地仓库推送到远程,但得到此错误:
错误:未找到存储库.
致命:远程端意外挂断.
我认为这是一个身份验证问题.当我跑的时候
ssh -T git@github.com
Run Code Online (Sandbox Code Playgroud)
我确实收到一条消息,表明我的密钥不起作用.所以我将〜/ .ssh/github_rsa.pub添加到我在GitHub帐户中的SSH密钥上(删除了那里已存在的密钥)并再次运行命令.这次我收到一条消息说 -
嗨septerr!您已成功通过身份验证,但GitHub不提供shell访问权限.
从我读到的这似乎是预期的消息.所以,我再次尝试推动.但收到同样的错误.找不到存储库.
Swapnas-MacBook-Pro:messages sony$ git remote -v show
origin git@github.com:seterr/messages.git (fetch)
origin git@github.com:seterr/messages.git (push)
Swapnas-MacBook-Pro:messages sony$ git push -u origin master
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
当我在GitHub上查看我的回购时,我看到:
现有的Git Repo?
cd existing_git_repo
git remote add origin git@github.com:septerr/messages.git
git push -u origin master
可能有什么不对?
这可能是非常简单的事情,但我似乎无法弄清楚为什么我的收集行动没有显示出来.根据文档,我需要做的就是调用传递给寄存器的块中的collection_actions方法.我想在我的用户的管理页面中添加一个名为"Notify All"的操作.这是代码:
ActiveAdmin.register User do
menu :label => "Users", :priority => 3
filter :twitter_id
filter :facebook_id
filter :created_at
filter :allows_notifications
filter :created_at
actions :all, except: [:destroy, :new]
collection_action :notify_all, :method => :post do
puts "notifying...."
end
batch_action :flag do |selection|
puts "flagging...."
end
index do
selectable_column
column "", :sortable => false do |user|
"<img src='#{user.avatar_url}' alt='user avatar' style='width:24px; height:24px;'/>".html_safe
end
column :uuid
column :twitter_id
column :facebook_id
column :allow_notifications do |user| user.allow_notifications ? "true" : "false" end
column :blocked do |user| …
Run Code Online (Sandbox Code Playgroud) 我在亚马逊的s6b99lczhnef6.cloudfront.net上有一个流媒体发行版.原点是S3中的一个桶.该桶有一个视频video.mp4.这是公开的.我正在尝试使用jwplayer测试流式传输此视频,以下是代码:
<html>
<head>
<script type="text/javascript" src="jwplayer/jwplayer.js"></script>
</head>
<body>
<div id="container">Loading the player ...</div>
<script type="text/javascript">
jwplayer("container").setup({
flashplayer: "jwplayer/player.swf",
file: "video.mp4",
height: 270,
provider: "rtmp",
streamer: "rtmp://s6b99lczhnef6.cloudfront.net/cfx/st",
width: 480
});
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
视频没有播放.没有JS错误.怎么可能出错?
每次我尝试将应用程序部署到连接的设备(iPad)时,我都会在 AppCode 中看到以下错误:
xcodebuild:错误:无法找到与 -destination 标志的参数匹配的目标:无法找到请求的设备,因为没有可用的设备与请求匹配。14 秒内构建失败,出现 2 个错误和 0 个警告
我可以很好地从 XCode 构建和部署。
我确信 AppCode 可以看到该设备,因为它列在下拉列表中(黄色 11 是设备):
附加信息:该项目使用 cocoapods XCode 版本为 5.1 AppCode 版本为 2.5.5 XCode 中的部署目标设置为 7.0 项目使用 SDK 7.1 iPad 运行于 iOS 7.0.4
我尝试过的事情: - 删除 DerivedData 文件夹的内容(通过 XCode 的 Organizer 窗口) - 再次关闭和启动 XCode 和 AppCode - 断开并重新连接设备 - 清理重建
为什么我这么想通过 AppCode 进行构建?因为它更容易调试,而且我知道那里的所有键盘快捷键。请帮忙。
我想在我的Users activeadmin页面上实现一个自定义操作(notify_all),单击该页面时将显示一个表单,该表单在提交时将路由到另一个自定义操作(send_notification_to_all).到目前为止,我一直无法使第二部分工作.
管理员/ users.rb的:
ActiveAdmin.register User do
action_item :only => :index do
link_to 'Notify All', notify_all_admin_users_path
end
collection_action :notify_all, :method => :get do
puts "notifying...."
end
collection_action :send_notification_to_all, :method => :post do
puts "sending notification...."
end
end
Run Code Online (Sandbox Code Playgroud)
单击"通知全部"按钮时,将呈现以下视图.意见/管理/用户/ notify_all.html.erb
<form action="send_notification_to_all" method="post">
<div><textarea rows="10" cols="100" placeholder="Enter message here"></textarea></div>
<div><input type="submit"></div>
</form>
Run Code Online (Sandbox Code Playgroud)
提交此表单后,我收到401 Unauthorized错误:
Started POST "/admin/users/send_notification_to_all" for 127.0.0.1 at 2014-02-12 14:08:27 -0600
Processing by Admin::UsersController#send_notification_to_all as HTML
WARNING: Can't verify CSRF token authenticity
AdminUser Load (0.8ms) SELECT "admin_users".* FROM "admin_users" …
Run Code Online (Sandbox Code Playgroud)