Rbenv: How to have two or more RUBY_CONFIGURE_OPTS when installing ruby? - rbenv

I want to install ruby with jemalloc without rdoc using the commands below but don't know how to combine them:
RUBY_CONFIGURE_OPTS=--with-jemalloc--disable-install-doc rbenv install 2.6.5 -v
RUBY_CONFIGURE_OPTS=--disable-install-doc rbenv install 2.6.5 -v

You can set multiple options by using double quote.
RUBY_CONFIGURE_OPTS="--with-jemalloc--disable-install-doc --disable-install-doc" rbenv install 2.6.5 -v

Related

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

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

YAML safe loading is not available

When I want to install compass with gem install compass, I occurred with this error:
YAML safe loading is not available.
Please upgrade psych to a version that supports safe loading (>= 2.0).
what The cause of this error and how can I solve the problem?
It sounds like the psych gem needs to be updated. Try running gem install psych and then gem update psych.
Suggested by looking at the psych readme file here: https://github.com/ruby/psych/blob/master/README.md
EDIT: you might also have to update your version of ruby. This depends on how you have installed ruby, but #ewerx has one suggestion in their answer.
To resolve this I first upgraded Ruby from 2.0.x to 2.4.2 (https://gorails.com/setup/osx/10.12-sierra):
rbenv install 2.4.2;
rbenv global 2.4.2
Then updated gems:
sudo gem update --system;
gem update
It may be sufficient to just update gems.
The following part of the post on https://gorails.com/setup/osx/10.12-sierra solved my issue.
We will be setting up a Ruby on Rails development environment on macOS 10.12 Sierra.
Older versions of OS X are mostly compatible so follow along as far as you can and then Google search for any problems you run into. There are plenty of people who have documented solutions for them.
Installing Homebrew
First, we need to install Homebrew. Homebrew allows us to install and compile software packages easily from source.
Homebrew comes with a very simple install script. When it asks you to install XCode CommandLine Tools, say yes.
Open Terminal and run the following command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installing Ruby
Choose the version of Ruby you want to install:
Now that we have Homebrew installed, we can use it to install Ruby.
We're going to use rbenv to install and manage our Ruby versions.
To do this, run the following commands in your Terminal:
brew install rbenv ruby-build
Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
Install Ruby
rbenv install 2.5.1
rbenv global 2.5.1
ruby -v

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

'rvm get head' unrecognized command line argument: 'get' (see: 'rvm usage') on Ubuntu 11.10 oneric

I have following version of rvm installed on ubuntu 11.0.
$ rvm -v
rvm 1.0.1 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]
However, on running rvm get head, I am getting following errors.
$ rvm get head && rvm reload
fail: Unrecognized command line argument: 'get' ( see: 'rvm usage' )
$ rvm update --head
rvm 1.0.1 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]
fatal: destination path 'rvm' already exists and is not an empty directory.
fatal: destination path 'rvm' already exists and is not an empty directory.
Can you help me find out what is the problem? and what to do to fix it?
You have very old RVM installation, probably from Ubuntu, use this answer:
Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v
It will help you clean your system and install stable version of RVM.
As a hint, you could use following command to install RVM, Ruby and Rails in one hit:
curl -L get.rvm.io | bash -i stable --rails --auto

install ruby 1.9.3 using rvm on ubuntu [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Ruby 1.9.2 and Rails 3 cannot open rails console
I have already installed rvm and ruby 1.9.2, both working properly. Using rvm version 1.10.2. I previously installed the rvm packages readline/zlib, but now I'm having big troubles with readline now. I'm trying to install ruby 1.9.3 in rvm, but I always end up having readline not found.
I tried to follow different solutions:
rvm remove 1.9.3
rvm pkg install readline
rvm install 1.9.3 --with-readline-dir=$rvm_path/usr/ \
--with-zlib-dir=$rvm_path/usr/
rvm use 1.9.3
rvmsudo gem install bundler
bundle install (all gems installed fine)
rails c / rails s
.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/irb/completion.rb:9:in `require': \
cannot load such file -- readline (LoadError)
I have libreadline-dev (version 6, the current one) installed (everything needed by those packages pretty much)
I also tried the following:
.rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb
checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
checking for readline() in -ledit... no
checking for editline/readline.h... no
.rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb \
--with-readline-dir=/home/claudiocontin/.rvm/usr/
checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
checking for readline() in -ledit... no
checking for editline/readline.h... no
.rvm/src/ruby-1.9.3-p0/ext/readline]$ ruby extconf.rb \
--with-readline-lib=/home/claudiocontin/.rvm/usr/
checking for tgetnum() in -lncurses... yes
checking for readline/readline.h... yes
checking for readline/history.h... yes
checking for readline() in -lreadline... no
checking for readline() in -ledit... no
checking for editline/readline.h... no
Makefile is not generated of course ...
apt-get install libreadline-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libreadline-dev is already the newest version.
Ideas?
I tried to do rvm pkg readline, install ubuntu pkgs etc without any success. What worked for me:
gem install rb-readline
And add the following line to your Gemfile:
gem 'rb-readline'
What I ended up doing is remove all the libreadline from rvm usr/lib/ path.
Installed libreadline5-dev package (.deb in this case) downloaded manually, because the new ubuntu distro has only libreadline6-dev as candidate.
went to rvm ruby 1.9.3 src and:
ruby extconf.rb --with-editline-dir=/usr/ --with-readline-dir=/usr/
make
sudo make install
Now works like a charm.
Very painful stuff :)
edit:
also keep in mind that readline uses also libeditline-dev now, you can disable manually when configure ruby readline , passing: --disable-libedit
ruby extconf --disable-libedit
I've always found getting RVM to play nicely with packages to be a bit of voodoo. A lot of times, it's about catching a dependency - I put together a script that I've had luck with in past, try this:
sudo apt-get install zlib1g-dev libssl-dev libsqlite3-dev libmysqlclient-dev imagemagick librmagick-ruby libxml2-dev libxslt1-dev build-essential openssl libreadline6 libreadline6-dev zlib1g libyaml-dev libsqlite3-0 sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libpq-dev libpq5 libmysql-ruby libmysqlclient-dev
rvm pkg install autoconf
rvm pkg install zlib
rvm pkg install readline
rvm pkg install openssl
rvm pkg install iconv
rvm install 1.9.3
rvm use 1.9.3 --default