I just migrated from Windows to Ubuntu, and I am trying to install Ruby 1.9.2 on Ubuntu.
I first installed RVM, and it worked fine.
I ran RVM install 1.9.2 and everything seemed to work fine: it downloaded, configured, compiled and installed everything. At the end, I had the #complete message ... so I thought everything ran fine...
But when I type ruby -v , I get a message
You can get Ruby in the following packages:
* Ruby 1.9.1
* Ruby 1.8
I then tried sudo apt-get ruby1.9.2, and I had a message saying that 1.9.2 would be replaced by 1.9.1
I did RVM install 1.8.7, everything seems to work fine, but I have at the end the same problem: Ruby is not recognized...
Typing which ruby does nothing (no answer, no error message).
I am a bit desesperate here, any idea to help me ?
Many thanks in advance !
Olivier
It looks like you are using "apt-get broken" RVM, follow this answer for instructions how to fix: Installed Ruby 1.9.3 with RVM but command line doesn't show ruby -v
And here is good tutorial for RVM: http://screencasts.org/episodes/how-to-use-rvm
Used rails on VM running Ubuntu 11.10 but after shutdown says "rails is not installed"
Follow the example I provided at the bottom, it works great.
First:
$ sudo apt-get remove rvm
then...
Copy and paste this into a shell.
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
have fun.
I have had terrible luck with the packaged version of rvm, just install from source via above.
Related
I am trying to install and set up my dev environment for RoR, on a Mac OSX Maverick 10.9.
After run the command:
$ rvm install ruby-2.0.0-p353
the following error out:
Installing required packages: libyaml, openssl.
Error running 'requirements_osx_brew_libs_install libyaml openssl',
showing last 15 lines of /Users/wlinares/.rvm/log/1388963243_ruby-2.0.0-p353/package_install_libyaml_openssl.log
esac;
return $ret
}
}
I downloaded libyaml from http://pyyaml.org/download/libyaml/ and installed following the default instructions.
Then I made the same for openssl so it was installed successfully under: /usr/lib/
Anyone has overcome this error? thanks!
You could try:
$ rvm install 2.0.0-p353 --autolibs=enable
After trying many tricks I could not overcome the issue, then I uninstalled everything and restart the process as a beginner I am. I decided to run the command.
$ gem install rails
then I installed gems:
$ gem install rubygems-update
and finally tested the environment with: rails new blog command.
Until here all seems to be working fine, but I am following the ruby guides in order to start coding my project. I don't have RVM now so I don't know how to handle with upgrades and versions.
That is my only problem, because I was told that Rails change frequently.
I would like to know now how to handle with upgrades including gems.
Ubuntu came with Ruby 1.8 installed, but I really would rather (and need, for rails) 1.9.2. I tried apt-get purge but apt doesn't believe there is a ruby package (however ruby -v keeps returning ruby 1.8).
I have installed rvm but ruby -v now only returns bash: /usr/bin/ruby: No such file or directory. I'm lost, any help?
I removed ruby from /usr/bin but it refuses to accept that rvm exists and keeps suggesting i install the 1.8 or 1.9.1 packages.
RVM is a bit wonky on Ubuntu. Look here for a fix before going any further.
If you have access to a GUI, try running The Synaptics Packet Manager
I had the same problem and Synaptics marked ruby 1.8 as installed. Unchecked the package, clicked on run and ruby was GONE
$ ruby -v now yields command not found
Now you can safely run
$ apt-get install rubyX.X.X
Happy coding!
I am new to Linux and Ruby. I have been searching for an answer but to no avail.
Using OpenSUSE 11.1
I recently downloaded the latest Ruby 1.9.2 and use the method make install from the source. I did not have the zlib back then.
Now, I cannot use the command "gem -d list ruby". The error says no such file to load -- zlib. I wanted to remove Ruby and RubyGem entirely from the system.
I tried using RVM but i couldn't figure it out on how to use. Been trying to install it for ages, but it is still useless, as the "type rvm | head -n1" comes out to rvm is hashed (usr/local/rvm/bin/rvm) even though I added the "[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session" to both .bash_profile and .bashrc.
Been working on it whole night. Any help is appreciated. Thanks in advance. :)
I had the exact same issue, installed Ruby 1.9.2 on openSUSE 11.4 using RVM. This was a clean install of openSUSE and I was trying to get a Rails development environment set up.
To address this, I removed my 1.9.2 instance using:
rvm uninstall 1.9.2
Then, I installed zlib-devel and openssl using:
sudo zypper install zlib-devel openssl
I then had to delete the 1.9.2 source files from rvm's src folder. This can be found under ~/.rvm/src
The source was there for ruby 1.9.2, rubygems, and yaml. I removed all three, leaving the ~/.rvm/src/rvm folder there in case it was needed by rvm.
Lastly, I re-installed ruby 1.9.2 using:
rvm install 1.9.2
Gems worked after that and I was able to do a gem update --system and gem install rails.
I hope this helps. I see this is an old, outstanding issue.
Mike
I just started reading Michael Hartl's Ruby on Rails 3 Tutorial. He recommends using the latest version of Ruby, currently 1.9.2. My Mac, an original Intel iMac now running Snow Leopard, has Ruby 1.8.7 installed.
Michael suggests installing the latest versions of Ruby and and Rails using the Ruby Version Manager (RVM). So I went to the RVM site and installed RVM with...
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
It seemed to work. A message popped up in the Terminal thanking me for using RVM.
Following Michael's next instruction, which is to make sure RVM is current:
rvm update --head
which results in -bash: rvm: command not found
A footnote suggests that I might need to install Subversion, so installed it, but I still get the same error message when I run rvm update --head.
Any suggestions? I'd really like to move beyond setup and get to building my Rails app.
rvm also gave a message after install saying you needed to add a line to your ~/.bashrc (or equivalent):
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.bashrc
do that, and then type . ~/.bashrc or open a new terminal.
I just installed ruby 1.9.2 on windows machine and Backspace or any other arrow keys don't work. This happens only when I open IRB on Git Bash console. But it works fine on Windows console. Any help on that?
Note: IRB was working fine on both consoles with the earlier versions of ruby.
Same thing happened to me. Running irb with --noreadline solved my problem:
irb --noreadline
Seems you didn't have readline installed while compile ruby. So install readline, maybe also readline-devel, then recompile ruby.
You can also disable readline in ~/.irbrc
IRB.conf[:USE_READLINE] = false
As documented here https://groups.google.com/forum/#!topic/rubyinstaller/HgswOz1T-eE, use the below command/alias:
alias irb="ruby -S irb"
If that doesn't work, use pry instead:
gem install pry
Install the rb-readline gem.
gem install rb-readline
Brief answer I had to do brew upgrade,(Apparently the situation, according to a ruby expert I spoke to, is that "There's a new default gem in trunk, Reline, that's a readline fallback.") . Then a new window and arrow keys in irb worked. Then sudo gem install pry, new window, and pry worked. ruby --version fell to 2.3 and I had to do brew install ruby, it said ruby 2.6 already installed and to do brew reinstall ruby, and it said to update the path, I did that and then fine. ruby 2.6 installed. edit- now rails is broken.. i'll update further.
More elaborate answer.
I had this issue of ruby irb arrow keys not working,
~/blah$ irb
irb(main):001:0> ^[[A^[[D^[[B^[[C
I am on osx, and don't think I had this issue some months ago
and also had an error when starting pry, pry<ENTER> it says "Reason: image not found - /usr/local/Cellar/ruby/2.5.0/lib/ruby/2.5.0/x86_64-darwin16/readline.bundle"
I tried brew link readline --force it didn't help, I tried irb --noreadline it didn't help
But what worked for me was this from a ruby expert- brew upgrade
Apparently the situation, according to a ruby expert I spoke to, is that "There's a new default gem in trunk, Reline, that's a readline fallback."
Then I started a new terminal window and $irb worked with arrow keys.
I then did sudo gem install pry , opened a new terminal window, and pry worked.
Ruby fell back to 2.3 when it should really be 2.6 and I thought it was 2.6
So I did brew install ruby, it said ruby 2.6 was already installed, and suggested brew reinstall ruby. so I did brew reinstall ruby . Opened a new terminal window. It was still on 2.3. But it suggested adding export PATH="/usr/local/opt/ruby/bin:$PATH" to .bash_profile (a file on osx that runs automatically). I did that it didn't work, but doing PATH="/usr/local/opt/ruby/bin:$PATH" manually at the start of each terminal session works.
edit- now rails is broken , i'll update further.
I got gem to work when I ran the one after updating the path..
This solution is not ideal as it gives two versions of ruby, and thus of course two versions of gem
Last login: Fri Aug 9 16:02:48 on ttys001
have run /Users/apple/.bash_profile
~$ cd /usr/local/opt/ruby/bin
/usr/local/opt/ruby/bin$ ls
bundle bundler erb gem irb rake rdoc ri ruby
/usr/local/opt/ruby/bin$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:~/rubymac/rubyrailshelperscripts:/opt/X11/bin:/Users/apple/.vimpkg/bin:/usr/local/opt/fzf/bin
/usr/local/opt/ruby/bin$ which gem
/usr/bin/gem
/usr/local/opt/ruby/bin$ cd ~/
~$ /usr/local/opt/ruby/bin/ruby --version
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin16]
~$ /usr/bin/ru
ruby runocc.d
~$ /usr/bin/ruby --version
ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin16]
~$