getting started (not) with Heroku: App not found - ruby-on-rails-3

This should be simple, and I swear it was working an hour ago. I can log in to Heroku, but can't run any useful commands:
$ heroku login
Enter your Heroku credentials.
Email: xxx#whatever.com
Password:
$ heroku stack
App not found
$ heroku config
App not found
Perhaps this is the source of the problem?
$ git remote show heroku
! No such app as empty-samurai-345
fatal: The remote end hung up unexpectedly
empty-samuri-345 was an app I deleted earlier. All I really want to do is upload a new app using the bamboo-mri-1.9.2 stack.
Thanks in advance for suggestions...

You need to remove the heroku remote in git using this command:
git remote rm heroku
Then you can add a new remote using this one:
git remote add heroku git#heroku.com:your-app.git
Then try running your heroku commands.

Run the following
git config -l
The config key is easy to spot, remote.heroku.url.
Now if your comfortable editing the config directly, just:
git config -e
If not:
# Confirm you've got the right key
git config remote.heroku.url
# Substitute your_app_name appropriately
git config remote.heroku.url git#heroku.com:your_app_name.git
My answer is based off fearless_fool's comment, which lacks much detail.
FYI: The config file is located in /your_git_repo/.git/config

I just ran into this same problem by renaming my app from heroku online dashboard.
Then I tried running some command in cli from my local machine and it gave 'App not found'. I guess Cli doesn't know the change that I renamed my app.
So I again logged into heroku website and renamed the app with old name.
Then All commands worked from cli.
So Don't use online dashboard to rename your app, use CLI.
I hope it helps someone..!!

Related

When i build the Telegram App it shows "SSignalKit/SSignalKit.h file not found"?

I cloned Telegram App but compilation fail with "SSignalKit/SSignalKit.h file not found"
What should i do to fix this?
You need to install the git submodules as well, this can be done with:
git submodule update --init --recursive
After successfully doing the that, build should fail because it cannot find the file config.h,
this can be fixed like described here.
Note: the submodules are linked with their ssh link, so if you don't have an authorized ssh for github on your mac, you either need to create one or change the links to the submodules repos from ssh links to https links (which can be found under [PROJECT_ROOT]/.gitmodules and [PROJECT_ROOT]/.git/config

Deploy to server with CircleCI and SCP

Say I have a repo that I'd like CircleCI to deploy after finishing the test sequence and the code is like so:
deployment:
staging:
branch: master
commands:
- scp -r wp-content/plugins/timespan username#servername.provider.host:public_html/wp-content/plugins
That works locally because I've set up the authentication that's necessary. But with CircleCI, that context isn't there and so it prompts for a password which I can't enter by having it on the next line, i.e. - passw0rd.
So I've tried a couple other things without success: 1) adding an ssh key into Circle and it rejects that by saying they don't support encrypted keys. 2) I tried using sshpass but wasn't able to add it as a dependency because of not knowing how nor which package manager to use to get it in.
Perhaps someone can enlighten me? I don't think this is too far off but am missing something.
You don't have to encrypt the SSH key.
I'm using CircleCi for the exact same thing, just add the uncrypted key to your SSH Permissions (you'll find it in your Project Settings on CircleCi in the "Permissions" section. Of course you will need the public key in your servers authorized_keys.
Otherwise you can add additional packages through your circle.yml: https://circleci.com/docs/installing-custom-software/
You can use your circle.yml file to run arbitrary commands against your build environment. You have root access to your environment via sudo, so you should be able to customize it to your heart’s content!
Example:
dependencies:
pre:
- sudo apt-get update; sudo apt-get install ssh-pass
I hope this will help you.
sshpass only needs to be installed on the client side. You do not need to install it on the server.
I am not familiar with CircleCI, but it sounds like you are trying to get it to install sshpass on the server, which is completely unnecessary. Just do sshpass -ppassw0rd scp ... in your CircleCI deployment script after having installed it on the server that runs CircleCI, and you should be fine.

How to config SSH for gitlab?

In my experience of Github, I tought that I need to clone a repository with my user like user#gitlabhost.com. But when I try this, then it does not recognize my password from gitlab. Only cloning with gitlab user does work.
Can anybody please help me??? - How do I have to configure gitlab access right?
If you followed Installation Instructions of gitlab, then you must have installed it on an linux box under the user named git. Typically in a folder like this
/home/git/gitlab
Hence you should use git#gitlabhost.com
I am not sure what you mean by "configuring SSH". But since each user is expected to use her own keypair, there should be no problem in accessing gitlab managed repo's using normal git commands. Both the following should work
git clone ssh://git#gitlabhost.com/group/repo.git
git clone git#gitlabhost.com:group/repo.git
Each user must have set their own git identity (on their local machines) using
git config --global user.name "elitmus"
git config --global user.email "abc#gmail.com"
so that git can uniquely identify each user.
In my experience, I had to connect to the gitlab server, as the git user, and modify the authenticated_keys file, as it was filled with a bunch of random #'s. after clearing that, I added my SSH key in the GitLab GUI and was able to clone and push normally.
Hope that helps.
https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent
Generating a new SSH key and adding it to GitLab or github or any ssh-agent
for more information
https://help.github.com/en/github/authenticating-to-github/about-ssh

Duplicate assets after deployment of app in Heroku

I'm very new with rails development and deployment using Heroku.
So recently I found that some JavaScript files that seems to be duplicated. For example I made a javascript function in one file (sample.js), then I erased this file, and I put the function inside of application.js.
Under my test development, it works perfect. But then when I commit the changes to heroku, I end up having the same function twice!
The javascript files are under the folder /app/assets/javascripts/
So how can I tell heroku to remove the duplicate files?
Am I missing some step before sending new version of my app to heroku?
Any help will be greatly appreciated
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
Rails 3.1.0
You're only deleting files from the repo when you use the git rm command. Even if you delete the actual file, it's still in the repo, and won't be changed by the git add -f * command (which only adds changed files).
You should be able to remove the file from heroku by running these commands:
$ git rm app/assets/javascripts/sample.js
$ git commit -m 'your commit message'
$ git push heroku master

Pulling my github repository and deploying it on apache

My Setup:
EC2 Instance with Ubuntu
Apache2 installed (publishes /var/www folder)
Git installed
SSH Keys Set:
$ ssh -T git#github.com
Hi User! You've successfully authenticated, but GitHub does not provide shell access.
My intention:
I want to pull a specific repository on github and publish it onto apache (basically puting the files into /var/www)
Where I am stuck:
Permissions of /var/www are set to root
trying to use sudo for cloning the repo results in a denied permission (root user uses different ssh keys?)
Where to clone my repo to? What diretory is appropriate for that?
How to copy the files then to /var/www?
I am quite new to Linux, so please help me :-) Thank you
I used root's ssh key and that works!
Just created new keys by using the sudo command and used them with github.