Installed heroku-toolbelt with homebrew, and foreman isn't included - ruby-on-rails

I'm using the homebrew package manager on Mac OSX, and I've installed the heroku-toolbelt package, which is supposed to include git, heroku CLI, and foreman. It only seems to include the first two:
$ brew info heroku-toolbelt
heroku-toolbelt: stable 3.20.0
https://toolbelt.heroku.com/other
/usr/local/Cellar/heroku-toolbelt/3.20.0 (438 files, 3.5M) *
Built from source
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/heroku-toolbelt.rb
$ which heroku
/usr/local/bin/heroku
$ which foreman
$ heroku --version
heroku-toolbelt/3.21.4 (x86_64-darwin13.0) ruby/2.1.2
$ foreman
bash: foreman: command not found
Any ideas why it's not appearing? Many thanks in advance.

If the heroku-toolbelt is installed through homebrew, you have the standalone version, as Daniel said.
If you like to install foreman as standalone as well, but with a package manager, you can install it as a gem:
gem install foreman
or
sudo gem install foreman
depending on how your ruby is setup.
More install info on foreman can be found on it's homepage.

The heroku-toolbelt being shipped within homebrew is the 'standalone' version.
This version includes 'Heroku client' only.
What you can do is get the Mac OS X version.
Then you can either use 'Heroku client' and 'Foreman' from there, or select to install 'Foreman' only (keeping the 'Heroku client' from homebrew).

https://devcenter.heroku.com/changelog-items/692
Starting August 12, 2015, new Heroku Toolbelt installs will not come with Foreman. The command heroku local has replaced foreman.

Related

Can't install fastlane on Mac OS Catalina

As per the steps given in fastlane docs, I am not able to install fastlane.
After running brew cask install fastlane, I get this pop up:
If I try to run from gem with sudo gem install fastlane, I get this error:
What I see is the ruby.h file is missing from the directory. As it says in the error, I need to install the ruby-dev environment separately. But I could not find how to do that. I saw apt-get commands for this, but then what about the ruby installed via brew?
ruby -v: ruby 2.6.3p62
brew -v: Homebrew 2.1.10
brew upgrade ruby: ruby 2.6.3 already installed
Since the error says we have to instal ruby as a separate package for development, I had to install rbenv as shown on ROR's website. You can check the full problem and solution here.
Run this to disable Gatekeeper:
sudo spctl --master-disable
Then install and run fastlane. When done, run this to re-enable Gatekeeper:
sudo spctl --master-enable
It will remember that you have permitted the application after re-enabling Gatekeeper and you will not have to run these commands every time you use it.
According to https://github.com/fastlane/fastlane/issues/15183
This is a common issue which nobody can solve it.
In case you can't update fastlane version
try
sudo gem install -n /usr/local/bin fastlane

facing issue with Install the Heroku CLI on Ubuntu 18 with rails

I am trying to run heroku on my terminal with heroku login command but everytime it show me this message
Install the Heroku CLI from https://cli.heroku.com
If i do heroku -v , heroku run rails c in all command it show me this same error
i did Gem install heroku it id done successfully.
than after same error everytime
Please help me to find solution about it.
You can't install the heroku CLI through rubygems (gem install).
You have to install following the guide here: https://devcenter.heroku.com/articles/heroku-cli#download-and-install
On Ubuntu install it with the following command: sudo snap install heroku --classic
On MacOS, if you have Homebrew installed, run brew install heroku/brew/heroku, otherwise download an installer and install Heroku using it.
If you want to run Heroku CLI, you need to install heroku in your ubuntu system.
on ubuntu 16+ versions you can install heroku cli with below command.
sudo snap install heroku --classic
you can't use any heroku command until its installed in your system

Redmine & rake version: how to update for user redmine

I need to update rake to version 12.2.1
I am using a Redmine docker image. So I tried to add to Gemfile the following line:
gem "rake", "12.2.1"
When I connect to my docker container running redmine, only under root user I see the updated version of rake, but as redmine user I see the older version, as shown by the following commands:
root# rake --version
rake, version 12.2.1
root# su - redmine
redmine$ rake --version
rake, version 10.4.2
I am not so confident with ruby and redmine, so I'm asking for any useful suggestions.
Thank you in advance.
Nicola
You should install your rake and ruby via rvm under redmine user, reffer to this question on stackoverflow How to correctly install RVM in Docker?
And once you are done with RVM, re-run bundle install for Redmine.
Already installed gems can be updated by using
bundle update <gemname>
doing that also make sure you are the right user (probably redmine in your case) and in the right path (e.g. the root of your Redmine)

The heroku command exists in these Ruby versions?

After I updated my Ruby version with rbenv I wasn't able to use the Heroku command-line tool.
I got this error:
> heroku
rbenv: heroku: command not found
The `heroku' command exists in these Ruby versions:
2.0.0-p195
Reinstalling the tool belt from toolbelt.heroku.com didn't help.
I switched to my previous Ruby version 2.0.0p195 and uninstalled the gem 'heroku'
rbenv global 2.0.0p195
gem uninstall heroku
Then I switched to the latest Ruby version 2.0.0p353 and reinstalled Toolbelt toolbelt.heroku.com
rbenv global 2.0.0p353
If you're using rbenv, here are the steps I follow to fix this.
The error
rbenv: heroku: command not found
The `heroku' command exists in these Ruby versions:
2.2.2
What to do
rbenv local 2.2.2
gem uninstall heroku
rbenv rehash
Good to go!
Heroku does not recommend using heroku gem from the recent times. If you have already installed the gem, uninstall the gem first with:
$ gem uninstall heroku
then install the toolbelt from Heroku as specified on Heroku site:
For ubuntu/debian:
$ wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
For other linux:
$ wget -qO- https://toolbelt.heroku.com/install.sh | sh
For Windows/MacOS see instructions on links.
I was having a similar issue. I had the heroku gem install on various ruby versions and despite the fact I had installed the heroku toolbelt from that package downloaded from their site, I was still getting:
rbenv: heroku: command not found
I found that after I had uninstalled the gem from all my ruby versions I had to run:
rbenv rehash
After that I found that everything work perfectly. I found this out from this stackoverflow answer:
ruby - heroku: command not found
I also had this problem, if you do the following command in the terminal:
which convert
And you get back this: Users/user_name/.rbenv/shims/convert, you should remove this file in your shims.
rm Users/user_name/.rbenv/shims/convert
If you do which convert again it should give back a different url: /usr/local/bin/convert
On MacOS, the thing here is that rbenv was getting confused along with brew and the heroku binary.
Heroku recommends a brew install for Macs. Now, you need to make sure that you don't have the gem installed with any other Ruby version managed with rbenv.
If you do, just reinstall them, and you'll be good to go.

Rails 3.2 not using bundled gems, Capistrano needs sudo gem install and rbenv not finding rails

I have 2 Rails 3.2.11 apps running on an Ubuntu 12.04 server with Nginx, Unicorn and Postgresql. Deployment is by git and capistrano.
After I installed the second app I found that Capistrano would fail during cap deploy because it "could not find a gem source" and I needed to install each missing gem using sudo. After this, cap deploy worked fine and so did the apps. Running bundle install from the current dir in either app reported using all the correct gems.
I am perplexed that Capistrano needs to find the gems before updating my app as my past experience (I think) was that I could run bundle install from the current dir to install any new or updated gems after cap deploy.
Today, I decided to update my Ruby version using rbenv on my dev laptop. I needed to run git pull from .rbenv/plugins/ruby-build and then rbenv rehash then I could install the new Ruby version. All good, ruby-v reports the new version 19.3-p374.
Now, when I run rails server (rails s) from my app dev dir I get rbenv: rails: command not found. The rails' command exists in these Ruby versions: 1.9.3-p327. rbenv version reports
1.9.3-p374. Rbenv which rails and bundle install both report "command not found: with rbenv error "Therails' command exists in these Ruby versions: 1.9.3-p327".
So, two issues which I believe are related:-
How to make each app on my server independently run its own gems using bundle install? I don't want to freeze the gems and am quite happy to keep both apps up to date simultaneously. Should I just keep installing the required gems using sudo?
How to fix the rbenv issue of not finding rails in the new version?
I needed to reinstall all gems again. Gem install bundler and then bundle update from each application directory.

Resources