小编the*_*ain的帖子

Heroku'权限被拒绝(publickey)致命:无法读取远程存储库的问题

我已经搜索了好几个小时,希望找到一个解决方案来解决我看似容易解决的问题.这并不是说我的搜索没有发现,而是我的搜索出现了许多不同的解决方案 - 其中没有一个有效.

无论如何,我根本无法从我的Mac上推送,拉取或从我的Heroku存储库中取出.每一次尝试都给了我(好像在嘲笑我)以下错误:

'权限被拒绝(公钥).致命:无法从远程存储库读取.

我已尝试(并重新尝试)以多种不同方式修复它.正如我所说,过去两天我花了很多时间寻找答案.以下是我尝试过的一些事情:

  • heroku键:清除后跟heroku键:添加
  • 使用'ssh-keygen -t rsa'自行重新生成ssh密钥
  • 清除我的.ssh目录,然后是heroku键:clear,然后生成一个ssh密钥
  • 删除我在heroku上的应用程序并重新创建一个(幸运的是没有多少在那里)

我可以从我的GitHub存储库中获取,所以我知道它不是网络连接(ping heroku也可以).

作为一个临时解决方案(我希望不会成为永久解决方案),我已登录到我的Ubuntu Amazon AWS ec2实例.从Heroku拉出和推动工作完美.出于这个原因,我仍然觉得我的Mac上的ssh键问题就好了.这两个键都显示在我的Heroku帐户下.密钥结束时的电子邮件地址是否重要?

编辑:我可以从GitHub推送和拉(但我没有使用ssh),为什么不是Heroku?

在这一点上,我愿意尝试任何事情.谢谢!

git ssh repository heroku public-key

139
推荐指数
5
解决办法
10万
查看次数

AngularJS:将函数传递给在其控制器中调用的指令的隔离范围?

我试图通过指令控制器中的"&"操作将从控制器范围传递的函数调用到指令中.然而,Angular声称该方法未定义.在一遍又一遍地阅读我的代码,搜索互联网,然后重复这个过程后,我决定转向这里提供帮助.

这是我的控制器的相关部分.它包含我传递给我的指令的方法.

angular.module('myApp.controllers', []).controller('PostCtrl', ['$scope', 'postalService', function($scope, postalService) {
    $scope.posts = [];

    $scope.getPosts = function() {
        postalService.getPosts(function(err, posts) {
            if(err);
            else $scope.posts = posts;
        });
    };
}]);
Run Code Online (Sandbox Code Playgroud)

这是我的指示.我无法调用onPost.

angular.module('myApp.directives', []).directive('compose', ['postalService', function(postalService) {
    return {
        restrict: 'E',
        transclude: false,
        replace: true,
        scope: {
            onPost: "&" //why will it not
        },
        templateUrl: "partials/components/compose-partial.html",
        controller: function($scope, postalService) {
            $scope.title = "";
            $scope.content = "";
            $scope.newPost = function() {
                postalService.newPost($scope.title, $scope.content, function(err) {
                    if(err) console.log(err + ":(");
                    else {
                        console.log("Success getting posts.");
                        //why …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-directive angularjs-scope

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

剪切当前上下文,使其被路径掩盖

给定绘制到上下文的路径,然后将其转换为CGImageRef,我将如何裁剪上下文(已绘制了提供的前景图像)到该上下文,以使所述上下文被CGImage屏蔽(以前是路径) ?

如果尚不清楚,下面的代码应更好地说明我的观点。请注意,所有这些都在UIView的drawRect:方法中调用,并且scaledImageRectangle(UIImage * image,CGRect rect)函数仅返回一个矩形。

    // Close the path
    CGContextClosePath(context);
    CGContextDrawPath(context, kCGPathFillStroke);

    // Mask the image
    CGImageRef mask = CGBitmapContextCreateImage(context);
    [foregroundImage drawInRect:scaledImageRectangle(foregroundImage, rect)];
    CGContextClipToMask(context, scaledImageRectangle(foregroundImage, rect), mask);

    // Finally draw the masked image
    UIImage *maskedImage = [UIImage imageWithCGImage:CGBitmapContextCreateImage(context)];
    [maskedImage drawInRect:scaledImageRectangle(foregroundImage, rect)];
Run Code Online (Sandbox Code Playgroud)

例如,这是带有黑色笔画的图像,代表路径 面膜前

这就是蒙版后图像的外观 面膜后

core-graphics objective-c quartz-graphics ios

4
推荐指数
1
解决办法
2606
查看次数