Rbenv: Ruby not installed Command 'ruby' not found (AWS t3a Ubuntu 18.04) - rbenv

I'm trying to install Ruby via Rbenv on Ubuntu 18.04 on AWS t3a using these instructions: https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-18-04
sudo apt update
sudo apt install -y autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm5 libgdbm-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
rbenv install 2.6.3
rbenv global 2.6.3
However, after the rbenv global 2.6.3 part and then run ruby -v, I get
Ruby not installed Command 'ruby' not found
But when I run rbenv versions it tells me 2.6.3 is listed.
How can I install ruby?

Used screen -d -r to see the error message which was uncommon.mk:545: recipe for target 'rdoc' failed
Found the solution in https://github.com/postmodern/ruby-install/issues/223
Instead of:
rbenv install 2.6.3
Do:
RUBY_CONFIGURE_OPTS=--disable-install-doc rbenv install 2.6.3

Try
bundle exec ruby
And should be work

Related

Can't install ruby 2.6.6 via rvm, error running '__rvm_make -10' on macbook pro m1

While installing the ruby 2.6.6 I'm getting this error:
Error running '__rvm_make -10'
please read /home/.rvm/log/1642694273_ruby-2.6.6/make.log
There has been an error while running make. Halting the installation.
I've tried to reinstall rvm but this changes nothing.
Other ruby versions are installed just fine.
rvm install 2.6.6 --with-out-ext=fiddle worked for me
downgrade libssl-dev with:
sudo apt install libssl-dev=1.1.1l-1ubuntu1.4
check the solution in this issue: https://github.com/rvm/rvm/issues/5209#issuecomment-1134927685
Right click Terminal from the Application/Utilities folder, Get Info, tick the "Open using Rosetta" box.
Uninstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
rm -rf /opt/homebrew/*
sudo rm -rf /opt/homebrew
Reinstall Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Restart terminal
Check Homebrew is working fine: brew doctor
Reinstall openssl: brew install openssl
Install Ruby: rvm install 2.5.3 Or any version
In case this helps anyone, none of the posted solutions worked on my intel MacBook Pro. brew doctor however did warn my developer tools were out of date. Uninstalling and reinstalling those allowed me to return to using RVM as normal:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

Watchman installation error

I started installing all I need according to react-native Get Started guide.
I installed Watchman and according to there guide.
I got following error while running ./configure command.
arafath#dell-pc:~/watchman$ ./configure
bash: ./configure: No such file or directory
OS - UBUNTU 16.04
I have succeeded in installing following things.
sudo apt-get install -y autoconf automake build-essential python-dev libssl-dev libtool

gem install pg only works as sudo

I have read a lot on this topic, but seems like nobody has had the exact problem I am having.
I am trying to install Postgres support for Rails 3 on Ubuntu. If I run:
sudo gem install pg
everything works fine.
However, I am using GemFile and trying to deploy my application to Heroku, so doing:
bundle install
As part of the bundle install it fails when doing gem install pg with the following error:
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.9/usr/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /Library/PostgreSQL/9.1/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
Any ideas why this is happening. Surely it would also fail to install as sudo if I do not have the correct libraries installed. Is this some kind of permissions problem?
Thanks for your help in advance,
Olli
I believe you need to install libpq. Please try:
sudo apt-get install libpq-dev
And btw, this may be a helpful hint for you. I usually setup my development environment using this chain (this is valid for Ubuntu 12.04 LTS):
sudo apt-get install libpq-dev build-essential openssl libreadline6 libreadline6-dev curl zlib1g \
zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev \
autoconf libc6-dev ncurses-dev automake libtool bison subversion ncurses-term \
exuberant-ctags libnotify-bin curl autoconf make automake ssh git-core git-doc imagemagick libpq-dev vim \
libreadline5 libmysqlclient-dev imagemagick libmagick+5 \
libmagick++-dev libmagickwand4 libmagickcore4 libmagickcore4-extra libmagickcore-dev \
libmagickwand-dev \
tmux libcurl4-openssl-dev \
libsqlite3-0 libsqlite3-dev sqlite3 postgresql-contrib mysql-server memcached \
gimp chromium-browser chromium-codecs-ffmpeg-extra chromium-browser-inspector \
bind9 terminator libqt4-dev xvfb gitk postgresql pgadmin3 rar unrar\
ubuntu-restricted-extras vlc compizconfig-settings-manager gstreamer0.10-plugins-ugly flashplugin-installer

Unable to install rvm on mac OSX 10.8.2

Error running 'make', please read /Users/Megha/.rvm/log/ruby-1.9.3-p374/make.log
There has been an error while running make. Halting the installation.
There is a new experimental way of dealing with dependencies in RVM => https://github.com/wayneeseguin/rvm/pull/1544 :
rvm get branch /features/improved_dependencies
rvm pkg remove
rvm remove 1.9.3
rvm install 1.9.3
You need the command lines tools (install xcode via the app store - then open it to install the command lines tools). I am talking 1Gb+ so it will take some time.
After that, get brew:
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
Update and run brew to install gcc:
brew update
brew tap homebrew/dupes
brew install apple-gcc42
Then RVM and ruby 1.9.3 should work:
curl -L https://get.rvm.io | bash -s stable --rails
rvm install 1.9.3

How to install ImageMagick for use with RVM

I had a non-rvm app going and decided to move to RVM. Now I'm noticing paperclip failing as ImageMagick isn't available.
[paperclip] An error was received while processing: #<Paperclip::CommandNotFoundError: Could not run the `identify` command. Please install ImageMagick.>
What's the right way to get ImageMagick installed on RVM?
On OS X if you have brew installed, you can simply use the following command:
brew install imagemagick
ImageMagick isn't a gem, it's a normal packet. On debian, the package name is imagemagick. You can install it via apt-get install imagemagick as root.
None of the above worked (on Ubuntu 10.10 64 bit)
I had to
sudo apt-get install imagemagick
sudo apt-get install libmagickcore-dev libmagickwand-dev
then
gem install rmagick
(in Rails 3.1)
On ubuntu, but this might also work on MacOS. You def want to compile from source when using ruby. Here the script I use
*install_imagemagick.sh*
#!/bin/bash
mkdir -p ~/local
command -v identify > /dev/null
if [ $? -eq 1 ]; then
echo "${bldgrn}Installing imagemagick into ${txtwht}$HOME/local/imagemagick${txtrst}"
wget -N --retr-symlinks ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
tar -xzvf ImageMagick.tar.gz
cd ImageMagick-*
./configure --prefix=$HOME/local/imagemagick
make
make install
cd ..
rm -rf ImageMagick-*
fi
Then I add this to my ~/.bashrc or ~/.zshrc
export PATH=$HOME/local/imagemagick/bin:$PATH
export LD_LIBRARY_PATH=$HOME/local/imagemagick/lib:$LD_LIBRARY_PATH
Then you can install your ruby bindings if necessary:
gem install rmagick
For Cygwin, remember to use:
http://www.imagemagick.org/download/binaries/ImageMagick-i686-pc-cygwin.tar.gz
instead of:
http://cygwin.com/packages/ImageMagick/
If you are on Ubuntu, you can install the package using:
apt-get install imagemagick