How to setup Heroku toolbelt on c9 - heroku

I'm having trouble with the directions from c9 documentation on setting up the Heroku Toolbelt on c9:
https://docs.c9.io/docs/deploying-via-cli
This is what I'm entering in the terminal:
$ awscli-bundle.zip\n$ apt-get awscli-bundle.zip\n$ manually update; heroku-toolbelt sh
However, it is returning an error:
bash: awscli-bundle.zipn$: command not found
bash: heroku-toolbelt: command not found

That section of the documentation looks badly mangled to me. awscli-bundle.zip is used for Amazon Web Services, not Heroku.
An older version of that page shows this command instead:
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
This looks a lot more reasonable.
I just tried this out on a new c9 VM and my heroku binary was successfully upgraded from version 3.43.13 to 3.43.16.

Related

"pre-commit" command is not found by bash but is installed on macOS

Problem Description
I'm having trouble making commits, when I try to make a commit with the command, for example:
$ git commit -m "add readme"
pre-commit not found. Install pre-commit with the command pip3 install --user pre-commit or follow the steps on official documentation: https://pre-commit.com /#install
Following the steps described in the pre-commit installation documentation I installed by the command:
$ pip install pre-commit
However when I trigger the command the following error occurs:
$ pre-commit --version
bash: pre-commit: command not found
My attempt fails
I've tried some other solutions for this but they didn't work:
Export bash
I already tried this solution described that would be to export my ~./bashrc with the command: source ~/.profile but the following error happens:
bash:/Users/pvieira/.profile: No such file or directory
Install using homebrew
Doing so the same error that occurs when installing by pip appears here.
I was able to solve the problem by simply restarting the terminal.
I solved this problem by restarting my ubuntu system

Unusual installation of `aws` cli

I am using "MacOS High Sierra".
I installed the aws cli tool a long time ago, don't remember how I installed it.
The installation is a little unusual.
I can run aws from any folder, this is working
$ aws --version
aws-cli/1.11.121 Python/2.7.13 Darwin/17.4.0 botocore/1.7.12
However running
$ which aws
this returns nothing.
I thought it might be an alias, but running
$ alias | grep aws
This also returns nothing.
Its not installed with homebrew either
$ brew list | grep aws
The reason why this is a problem, because there have now been a few cli programs I have ran (Including "AWS Sam" and a build script from my work) which are complaining because aws is not in the path.
I would much rather have a "regular installation" of the aws cli, where I put the executable in some bin folder and then put it in the environment path.
But instead its using some "magic" which I am unfamiliar with. And not even AWS owns tools ("AWS Sam") seem to like the way its installed.
Any advice would be appreciated.
I solved the problem by running
$ pip uninstall awscli
$ brew upgrade
$ brew install awscli
Now I get this result
$ which aws
/usr/local/bin/aws
"AWS Sam" and the other build script I use at work are now working.

Heroku Toolbelt Issues on osx 10.5.8

So I am just beginning to work with heroku (on an old MBP running osx 10.5.8) and I am having some issues with the toolbelt. The installation finished with no errors, however I am unable to run any of the heroku commands from my terminal. I am running ruby 1.9.3 through rvm (if that helps). The 'which heroku' command gives:
$ which heroku
/usr/bin/heroku
All other commands beginning with 'heroku' return the following error (using login as an example):
$ heroku login
dyld: unknown required load command 0x80000022
Trace/BPT trap
If anyone could shed some light on this for me, it would be greatly appreciated. Also let me know if I am leaving out any info. Thanks!
EDIT: Also, I did re-install the older version of git for osx 10.5.8 as suggested by many forums and here https://github.com/heroku/heroku/issues/324 (I know this specific post is pointed at git breaking, however it seemed to be the general answer on most forums that had anything remotely related to my problem)
Seems it was actually a simple fix. The Heroku gem itself was never installed by the toolbelt (I assume it should have been?). The fix was:
$ gem install heroku

The git user is unable to execute bundle during GitLab installation

I am trying to install GitLab on a Debian Wheezy and experiencing an issue I don't understand.
Following the install guide for version 5.0:
step 1: was run as explained
step 2: I used rvm (multi-user install) instead (ruby-1.9.3-p392)
steps 3 to 5: were run as explained (MySQL chosen)
step 6: everything works fine until the "Install Gems" section, where I get the following error:
/home/git/gitlab$ sudo -u git -H bundle install --deployment --without development test postgres
sudo: unable to execute /usr/local/bin/bundle: No such file or directory
I run this as my normal user (in the sudo and rvm groups), and the git user is not a sudoer.
I think that the line sudo gem install bundler, in step 2, does not grant the git user to execute bundle properly, but I don't know how to fix this.
I probably did something wrong but cannot figure out what it is, as I tried to respect the standard instructions as close as possible.
Any clue about this? Thanks, I am losing hope...
For information, I have written to the GitLab mailing-list about this problem but did not get any answer. Moreover, last time I asked something similar on ServerFault, I have been advised to post on StackOverflow instead... hence this question :)
When I do $ which bundle, I get /usr/local/rvm/gems/ruby-1.9.3-p392/bin/bundle.
The git user has been created with the --disabled-login flag and thus I cannot login as git to run bundle.
When I do $ sudo -u git bundle, I get
sudo: unable to execute /usr/local/bin/bundle: No such file or directory
That means git user has not /usr/local/rvm/gems/ruby-1.9.3-p392/bin in its PATH, and you cannot modify its .profile or .bashrc because of the --disabled-login flag.
It seems that running sudo -i -u git bundle instead of sudo -u git bundle does the trick
That is the safest route, and will execute the command as git, but will simulate first an initial login, using the PATH defined in .profile and .bashrc of user root.
See "How does sudo search the path for executable?" for more.
On my local machine after upgrade from 6.4 to 7.7 I had such issue.
The compilation of ruby was made under root account.
So need permissions to read compiled ruby and installed bundle.
chmod ugo+rx /usr/local/bin/bundle
chmod -R ugo+rX /usr/local/lib/ruby/
In production mode You could be more strict.

New Ruby user trouble installing RVM

Before I start, let me say that I looked at all the similar questions and it appears that no one had this particular problem:
I installed git.
Next I ran this from the command line:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
My result is
bash: line 151: git: command not found
bash: line 153: git: command not found
ERROR: Unable to clone the RVM repository, attempted both git:// and https://
What did I do wrong here? I am attempting to install this on osx Lion.
Additionally, can someone explain to me what the beginning of the bash command does? bash < <(...)
Just for my own curiosity :)
Thanks!
You need to have git installed first. The command executes the script downloaded with curl from the given url using bash. The <(...) is apparently used to provide a list of commands as per http://tldp.org/LDP/abs/html/process-sub.html.
You either installed git wrong, or it's not in your path. Have you installed XCode? It should automatically install git 1.7.4 and put it in your path. You'll also need to have XCode installed to be able to compile any ruby versions using RVM.

Resources