heroku pg:psql --app my-app fails with command not found - ruby-on-rails-3

Environment
Mac OSX Maverick
Rails 3.2.11
Ruby 1.9.2p290
Heroku toolbelt
From my terminal:
$ heroku pg:psql --app my-app
---> Connecting to HEROKU_POSTGRESQL_CYAN_URL (DATABASE_URL)
sh: psql: command not found

This means that you don't have the psql command in your system. Try which psql to confirm. If you have installed postgres, then it means that its bin directory is not in your $PATH. If you haven't installed postgres yet, then install postgres and try again.

Run brew install postgres and it should work.

Related

Why is brew install redis not working for mac M1?

I have to install redis, but it is not working to install redis anymore using brew. Getting the following error when trying to install this way:
Warning: No available formula with the name "redis".
==> Searching for similarly named formulae and casks...
==> Casks
another-redis-desktop-manager ✔ redis-pro
jpadilla-redis redisinsight
medis
To install another-redis-desktop-manager ✔, run:
brew install --cask another-redis-desktop-manager ✔
Tried the command brew install --cask another-redis-desktop-manager.
This also didn't work.
Actually found the answer. Basically the reason for the failure in installation was because the core homebrew packages were not correctly configured.
Identified the issue with brew doctor
The solution was
rm -rf "/opt/homebrew/Library/Taps/homebrew/homebrew-core"
brew tap homebrew/core
ARM Homebrew must be installed in the /opt/homebrew directory. Earlier, you need to manually create directories and run commands. However, you do not need to manually run commands to use the latest scripts.
Direct execution:
/bin/bash -c "$(curl -fsSL https://gitee.com/ineo6/homebrew-install/raw/master/install.sh)"
PS: terminal type Run the echo $SHELL command. The command output is as follows:
/bin/bash => bash => .bash_profile
/bin/zsh => zsh => .zprofile
If you encounter invalid environment variables, you are advised to check the terminal type before setting the correct environment variables.
Starting with macOS Catalina(10.15.x), Macs use zsh as the default Shell, using.zprofile, so the corresponding command:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
If you have macOS Mojave or later and have not configured zsh yourself, use.bash_profile:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.bash_profile
eval "$(/opt/homebrew/bin/brew shellenv)"
Hope this can help you

Unable to install ruby using RVM on WSL 2 and Ubuntu

I have a windows 10 machine with WSL 2 and Ubuntu 20.x installed. I installed RVM on Ubuntu. RVM seems to be installed fine, but when I try and install a ruby rvm install 3.1.2 I get the error mkdir: cannot create directory ‘/usr/share/rvm/log/1658255479_ruby-3.1.2’: Permission denied Anything special I should be doing on WSL 2 to make this work?
I can reproduce this exact error if I try rvm install 3.1.2 without having added my user to the rvm group per the installation instructions. Is it possible that you missed this step?
sudo usermod -a -G rvm $USER
After adding the user, then exiting the shell/WSL and restarting, rvm install 3.1.2 (almost) worked as expected. It appears there's a slight bug where it asks for the sudo password on the same line as a previous Updating system.. line, so it's easy to miss, but this is recoverable.

Installation of RVM on Ubuntu Server 12.04

I am running a VM with Ubuntu Server 12.04.
I try to install a Ruby on Rails Application and first of all i needed to install Curl (which is done) and now i try to install RVM.
I am following this installation guide : ruby on rails installation
i am at the step when i have to run rvm to check. But it won't load when i try to enter :
source ~/.rvm/scripts/rvm
UPDATE :
I have this folder /usr/local/rvm
when i try to run this : rvm requirements
he says : the program 'rvm' is currently not installed....
but i did with this command :
\curl -L https://get.rvm.io | bash -s stable
as shown in the tutorial, or didn't it install ? i have no errors...
i even see : thank you for using rvm!
-sh: 1: source: not found
any ideas? i am relatively new to ubuntu. thanks in advance
as the message says:
-sh: 1: source: not found
where sh is your current shell - RVM is not compatible with it, you need to use bash:
sudo apt-get install -y bash && sudo chsh -s $(which bash)
I have not tested this steps so you might slightly adjust it for your system.
For RVM to work properly, you have to set the 'Run command as login shell' checkbox on the Title and Command tab inside of gnome-terminal's Settings page.
To do that open up a terminal by pressing CTRL+ALT+t. Once your terminal is open, right click the terminal, and click on Profiles then Profile Preferences.
Screen shot at http://rvm.io/integration/gnome-terminal

cap deploy:migrations fails with Could not locate Gemfile

I'm working on my first rails deployment and having a problem I can't figure out.
mac osx 10.8.2
ruby 1.8.7
Rails 3.2.6
rvm 1.17.2
I've been following this tutorial http://brandnewrails.wordpress.com/ and got stuck on 7c.
I set it all up in RVM, got git running on the server, ran bundle install in the app, and wrote the Capistrano recipe in my_app/config/deploy.rb
Then I ran:
$ capify . no problem
$ cap deploy:setup no errors
$ cap deploy:check returned You appear to have all necessary dependencies installed
$ cap deploy:migrations is where the problem happens. After successfully running a bunch of the commands, capistrano fails. See below:
2012-12-10 00:43:56 executing `bundle_install'
* executing "cd /home/{servername}/party/releases/20121209134354 && bundle install --path vendor/bundle"
servers: ["{servername}"]
[{servername}] executing command
** [out :: {servername}] Could not locate Gemfile
command finished in 694ms
failed: "sh -c 'cd /home/alexchee/party/releases/20121209134354 && bundle install --path vendor/bundle'" on {servername}
Does anyone know what to do? When I check the app directory, the Gemfile is there. Any ideas or further questions?
The inability of capistrano to locate a Gemfile in this case seems to be a symptom of not having initiated git in the app locally, that is on my own computer.
My hunch is that since Gemfile is the first file in the list above, that is why it created an error first. If the program had continued, it would have probably had other errors as well.
Even if git is running on the server and the app is bundled up correctly, you must also initiate git locally and direct it to the appropriate files on your server in order for the deploy to work.
Great instructions are listed here: http://brandnewrails.wordpress.com/2012/10/14/lesson-7b/

I can't seem to get rails installed on my Mac (10.6.5). Following Ruby on Rails Tutorial 3

I'm trying to get Rails 3 up and running by following the steps outlined in "Ruby on Rails Tutorial" by Michael Hartl (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book).
The details start in section 1.2.2 (http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:rubygems). Here you go through the following steps:
Installing Git
Installing Ruby (version 1.9.2) using Ruby Version Manager (RVM)
Creating different gemsets for environments using Ruby 1.8.7 and 1.9.2
Installing RubyGems
and finally, installing Rails.
I run the following command [sudo] gem install rails --version 3.0.7
Everything seemed to install correctly (based on no errors). However, when I type "rails -v", rails cannot be found.
I am a Rails newbie. I'm trying to install Rails on a machine running Mac OS X 10.6.7.
Thanks.
If you are using RVM you probably don't want to use sudo when installing gems. If you have Git installed only steps needed to get Rails are:
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.zshrc
# Reload your shell now (open a new terminal for example)
rvm install 1.9.2
rvm 1.9.2 --default
gem install rails --version 3.0.7
hash -r
This skips the gemsets part (you don't need it if you are just starting learning Rails) and assumes that you use Zsh (I think it's Mac OS X default, if you use Bash then you have to alter .bashrc, not .zshrc).
If you want to remove your previous installation and start over use rvm implode.