How to compile Ruby with Readline support? - ruby-on-rails

I'm running Linux Mint 15 which is based on Ubuntu 13.10. I installed Ruby with RVM. I'm trying to run Rails and I get the following error:
You're running a version of ruby with no Readline support
Please `gem install rb-readline` or recompile ruby --with-readline.
I tried every suggestion I found here on SO regarding this problem but I still get this error when trying to run rails server. The suggested website for the fix http://beginrescueend.com/packages/readline/ is unavailable.

For macOS: https://github.com/guard/guard/wiki/Add-Readline-support-to-Ruby-on-Mac-OS-X
RUBY_CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline` rbenv install 2.3.1

This was answered here for ubuntu/rvm combination: How to get Readline support in IRB using RVM on Ubuntu 11.10
I use chruby/ruby-build for the task, with ruby-build it can be done just like that(you can install it even to rvm folder):
export RUBY_CONFIGURE_OPTS=--with-readline-dir=/your/readline/headers/path
ruby-build 2.0.0 ~/.rvm/rubies/

Related

Trying to install Rails 6 using RVM

I have installed RVM successfully on my Mac and using it I have installed Ruby 2.6.3. I have set my current and default version of Ruby to be 2.6.3. Everything seems to be fine because when I enter ruby -v into the terminal it tells me I'm using ruby 2.6.3.
My problem comes when I try to install Rails 6, I'm entering:
gem install rails --version=6.0.0 -no-ri -no-rdoc
It seems to install correctly however when I try to confirm with:
rails -v
I get:
Rails 6 requires Ruby 2.5.0 or newer.
You're running
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64- darwin18]
Please upgrade to Ruby 2.5.0 or newer to continue.
Why am I getting this message when my ruby -v command is telling me that I am using ruby 2.6.3
Any help would be very welcome.
You're running ruby 2.3.7p456. You need to set your local ruby version to 2.6.3.
Try which ruby to see which ruby version is loaded.
rvm install 2.6.3
rvm use 2.6.3
You can then see which ruby is running with which ruby.
See the basics on the rvm docs
As an aside, I also recommend recommend rbenv over rvm; however, you can only have one installed. If you have both installed, you're going to have a bad time.
To make sure you do not have both installed try which rbenv, and that should return rbenv not found
Please edit your original question with the output of the following commands:
which -a ruby
echo $PATH (That will help debug if your $PATH is set up incorrectly.)
which rbenv
ls (in your project directory)
i also had the similar problem which i resolved by uninstalling rvm completely and then installing rbenv.

Uninstall Ruby, rbenv and homebrew and reinstall Ruby on Rails with RVM on MAC

I'm very new to RoR specially on Mac. I have installed it many times on Ubuntu with RVM and I'm very comfortable with that. Here is what happened on Mac:
I went through instructions as explained here http://goo.gl/zsHcCC then when I got to the point to install Rails with " gem install rails " I got this error:
Error installing rails:
ERROR: Failed to build gem native extension.
Now I want to roll-back everything and uninstall rbenv and it's ruby versions and reinstall the Ruby On Rails environment using RVM.
I tried to find how to uninstall Homebrew, RBENV and Ruby, but no success.
Thank you.
Sia
Homebrew or Rbenv are very good tools to have as a dev, I would think twice before removing either.
In this case I doubt they are at fault.
Can you confirm you have installed the GCC command line utils for OSX by running $ xcode-select --install in your terminal.
Here is a useful post explaining that process but I find that command generally works fine for me.
If this succeeds what does your $ gem install rails output next?
If you are very new you and you don't need specially the last version of Ruby. You can use Rails Installer http://railsinstaller.org/fr-FR.
To uninstall brew https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/FAQ.md

Why do I get a requirements error when trying to install Ruby with RVM?

I would like to install Ruby 2.0 with RVM on my Ubuntu system and get an error message:
rvm 1.23.5 (master)
ubuntu 12.04 (LTS)
**---- Error message: -------**
rvm install 2.0.0
Searching for binary rubies, this might take some time.
Checking requirements for ubuntu.
Installing requirements for ubuntu.
Updating system.....................................................................................................................................
Error running 'requirements_debian_update_system ruby-2.0.0-p247',
please read /home/emzett/.rvm/log/1381812161_ruby-2.0.0-p247/update_system.log
Requirements installation failed with status: 100.
Update the system using:
sudo apt-get update
Try:
rvm remove 2.0.0 # uninstall rvm
rvm get head --autolibs=3 # get the latest RVM and build required libs
rvm requirements # check if there are any dependencies that need to be installed.
rvm install ruby-2.0.0
I solved the problem by editing
etc/apt/source.list.d/medibuntu.list
I just commented the line referring to medibuntu out.
https://gist.github.com/pcjpcj2/5443017
I recommend this gist.
if you need Ruby on Rails 4.0 ~ , best answer is here
I had the same issue. I ran the following command to fix it:
sudo apt-get -f install
Then I remembered that I failed installing a package earlier that day. What this command did was resolve the dependencies on that package and allowed RVM to do its thing.
This happens when there are broken sources in /etc/apt/sources.list.d or /etc/apt/sources.list.d
You can run Ubuntu Software update to see if there are any any failures due to broken sources, if so, follow the below steps
fix them or comment and execute the following steps
rvm requirements -- this will install all of
the required software modules
rvm list -- provides you the available versions of ruby
rvm install ruby-x.x.x -- This will install x.x.x version of ruby, please change the ruby-x.x.x with the version you are interested in ex (ruby-2.1.0 for 2.1.0 version of ruby)

Facing difficulty in Installation of Interactive Ruby shell and ruby in ubuntu 13.04 and getting started with rails

Accidently I have installed both versions of ruby on my system and now the default version is set to
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
but I need to set the default version to 2.0.0...
for this I used the command
$ rvm 2.0.0p294 --default
but it says rvm is not currently installed though I installed it, typing various commands(via google) .
Also I want to install an Integrated Ruby shell in ubuntu 13.04, do suggest how to do it.
I have also installed Aptana Studio on my system, now how should I get started with it.
Finally, the last problem is tell me how to check whether rails is currently installed in my system or not...
Thanx in advance!!
to use a gemset try writing
rvm use ruby_gemset_version
to check the rails version try to type rails -v
you have to install RVM (ruby version manager), then you have control to use any specific versions of ruby, and coming to rails you have to manually install rails gem once you have installed rvm and selected a version.
This would be helpful to install rvm
https://rvm.io/rvm/install
After installation you have to install ruby versions.
Then you can use the following cmd
$ rvm use 2.0.0
to use ruby 2.0.0
Thank you.
Go to this http://rvm.io/rvm/install It has instruction to install and cofigure RVM. It is dependant on CURL lib. So make sure you have curl installed in your system, if not then the command is
#sudo apt-get install curl
Once it is intalled and configured properly.
On Ubuntu:
GoTo Terminal > Profile Preferences > Title and Command > Set checkbox for (Run command as login shell)
Install rubies using rvm install.

Vanishing Ruby Gems

I'm using Ubuntu 8.10 and I installed Ruby and Ruby on Rails following the directions on this site. The exact directions I followed are no longer there as it appears the rubyonrails.org wiki has changed recently. But I installed it the long way. Installed Ruby, then Gems, then installed Rails using "gem install rails".
I haven't really messed with Rails for a while, and I tried to use the Gem command today and...
The program 'gem' can be found in the following packages:
* rubygems1.8
* rubygems1.9
Try: sudo apt-get install <selected package>
bash: gem: command not found
That's just weird to me because I installed rails using the gem command. I have been seaching my computer for the gems binary so I could create a link to it in the bin directory but I can't find it. I know it's installed becaues when I run 'script/server' and go to localhost:3000 in a browser I get the following version information:
Ruby version 1.8.7 (i486-linux)
RubyGems version 1.3.1
Rails version 2.2.2
Active Record version 2.2.2
Action Pack version 2.2.2
Active Resource version 2.2.2
Action Mailer version 2.2.2
Active Support version 2.2.2
Anyone know how I can get my gem command working again? Thanks for any help.
Note: I am new to Rails and fairly new to Ubuntu and Linux in general.
Did you install rubygems from apt-get? If yes, maybe you should try to remove it and install it from source.
Here is another article on installing Rails on Ubuntu:
http://www.rubyinside.com/how-to-install-a-ruby-18-stack-on-ubuntu-810-from-scratch-1566.html
Essentially, you can install Ruby from apt-get or source, but it's recommended to install rubygems from source.
You could look to see if it's in:
/usr/bin/gem1.8
if it is, then symlink /usr/bin/gem to it:
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
BTW, here's another tutorial on how to install rails on Ubuntu 8.10:
http://articles.slicehost.com/2009/1/6/ubuntu-intrepid-ruby-on-rails

Resources