facing issue with Install the Heroku CLI on Ubuntu 18 with rails - ruby-on-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

Related

Can't run rails -v in proejct folder on ubuntu 20.04 server

Ruby version: 3.1.0
Rails version: 7.0.4
RVM 1.29.12
Ubuntu 20.04
It is a digital ocean droplet
I have SSH'ed into an ubuntu 20.04 server.
I have installed rvm and rails.
If I stand in the rails user folder and write rails -v it gives me the rail version.
If I go into a project folder and try the same thing it just says.
Could not find rails-7.0.4, sprockets-rails-3.4.2, puma-5.6.5, importmap-rails-1.1.5, turbo-rails-1.3.2, stimulus-rails-1.1.0, jbuilder-2.11.5, bootstrap-5.2.2, simple_form-5.1.0, ransack-3.2.1, bootstrap-select-rails-1.13.8, jquery-rails-4.5.0, sqlite3-1.5.3-x86_64-linux, sprockets-4.1.1, sassc-rails-2.1.2, sassc-2.4.0, tilt-2.0.11, ffi-1.15.5 in locally installed gems
Run `bundle install` to install missing gems.
Running bundle install ends with the text "Killed"
My bundle config is
---
BUNDLE_DEPLOYMENT: "true"
BUNDLE_WITHOUT: "development:test"
BUNDLE_PATH: "vendor/bundle"
It seems bundle install doesn't install ffi 1.15.5 correct.
Installing ffi 1.15.5 with native extensions
Killed
and it does that everytime I run bundle install
I tried to run rails -v in the rails user folder
and it gives the rails version.
If I try in the project folder
It throws an error and ask me to run bundle install.
I run bundle install and it seems to finish without issues, but it doesn't fix the problem
Try bundle exec rails -v in your project folder.
Solved it by upgrading the server to 1 gb ram instead of 512 mb

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

How to resolve Rails issue- An error occurred while installing mysql2 (0.4.4), and Bundler cannot continue

you may get this issue while working on Rails 4.0 and above version along with Ruby 2.0 and above.
this is very common issue if you are going ahead with up gradation of Rails environment.
Steps to be follow-
For Windows System-
1.Download the the newest mysql-connector to c:\mysql-connector folder
2. gem install mysql2 -- '--with-mysql-include="C:\mysql-connector\include" --with-mysql-lib="C:\mysql-connector\lib"
Hopefully it will work for you.
For Ubuntu System-
1. open terminal (Ctrl+alt+T)
2. $ sudo apt-get install libmysqld-dev
Run bundle from your project directory
3. $ bundle
This will resolve the issue.We can also see the solution here.
https://randvblog.wordpress.com/2016/06/20/how-to-resolve-rails-issue-an-error-occurred-while-installing-mysql2-0-4-4-and-bundler-cannot-continue-make-sure-that-gem-install-mysql2-v-0-4-4-succeeds-before-bundling/
I got this issue resolved with following steps as-
open terminal (Ctrl+alt+T)
$ sudo apt-get install libmysqld-dev
Run bundle from your project directory
$ bundle
rails s
Now rails app is working fine.

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

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.

GIT command not found on Fedora 18

I am trying to deploy a Rails application using Capistrano. My application is on a Git repository on BitBucket.
Before deploying the application I needed to install Git on the server running Fedora 18. I tried the following:
sudo yum install git
and
sudo yum install git-core
Both commands showed that Git was installed successfully, but when I try to use the git command I receive a git command not found error.
How can I install Git with Fedora 18 and make this work?
SOLVED: Although, Fedora wrote that git has been installed, it was not. I tried to re-install git, following carefully what was written in the terminal during the installation and it worked.

Resources