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
Related
Namaste!
Wanting to check out the shiny new Rails 5.0, I bumped into an error saying I need to upgrade my Ruby version to a minimum 2.0.0 (my current version being 2.1.3). I use RVM to manage Rubies on my OSX, so I tried the good ol'
rvm install ruby --latest
...only to be told
Already installed ruby-2.1.3.
I ran
rvm known list
...and indeed, the latest version of Ruby listed was the one I already have, i.e, 2.1.3. Next, I checked my RVM version and found it to be 1.25.31, while the RVM blog states 1.27.x was recently released. So I decided maybe this is the reason the known list doesn't show newer Ruby versions and used the documented steps of upgrading RVM from their site. After reloading, I still see the same version of RVM and the same list of available Ruby versions. I tried restarting Terminal too. What do I do now?
Install RVM from scratch
1) First remove the current version, see: https://stackoverflow.com/a/3558763/1076207
# use sudo at your own discretion
rvm implode --force
gem uninstall rvm
rm -rf ~/.rvm
# open file
vim ~/.bash_profile
# remove lines:
# [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
# close file
2) Follow the directions on the RVM install page: https://rvm.io/rvm/install
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.
I've run into a lot of issues whilst attempting to install RVM on Ubuntu 9.10. Here's the steps I've tried doing:
install ruby (via ruby site, no package manager)
download rvm
install rvm (make edit to .bashrc)
use rvm to install ruby version & gems
Is there any crucial step that I seem to be missing?
Be sure to have selected an installed ruby (the --default portion tells rvm you want this ruby to be your default ruby version). Something like:
rvm --default use 1.9.2
Also this command will tell you which ruby is currently selected:
rvm list
And hopefully you'll see something like:
rvm rubies
ruby-1.9.2-p0 [ x86_64 ]
=> ruby-1.8.7-p302 [ x86_64 ]
At this point, you'll be able to install gems and hopefully have a successful rvm install and working environment.
I've had issues in the past where I didn't have an rvm ruby selected and was still working with my distribution's ruby and gems and got mixed up easily. Make sure you're ruby and gem commands are working out of your ~/.rvm folder whith the following commands:
which ruby
which gem
Good luck!
What are the issues you're running into? Sometimes I forget to switch into the correct rvm environment (e.g. rvm ree), so it helps to place a .rvmrc file in project directories.
I would start off by removing ubuntu's ruby installation so that you don't have to worry about conflicts (although rvm will setup your PATH correctly). Following the instructions at RVM, run the following command to install rvm,
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
and then install system dependencies as listed in rvm notes. and then install the specific ruby version you want (e.g. rvm install ree or rvm install 1.9.1)
Important : for a good installation try this :
type rvm | head -n1
Must return : rvm is a function
else add this line
[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm"
in your profile.
Trying to install the new Rails 3 release on OSX 10.6.
Have never touched Ruby or Rails on this machine since purchased.
I was able to get rvm and get Ruby 1.9.2. installed. From there, I am stuck.
I tried:
rvmsudo gem install rails -v 3.0.0
sudo gem install rails --pre
sudo gem install rails
sudo gem update rails
And I get the same result error each time:
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - /Users/kevin/.rvm/gems/ruby-1.9.2-head#rails3/cache/activesupport-3.0.0.gem
If I do gem list, it says LOCAL GEMS and doesn't list anything.
I have read a few walkthroughs but honestly none of them address this issue and its kind of pissing me off. Why is this so difficult to install? Would love to learn it if someone could help me get it running.
I was trying to follow this:
http://eddorre.com/posts/installing-rails-3-beta-4-using-rvm
and this:
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard
Which is actually linked from the ROR guides website. Am I missing dependencies? How do I get them in?
If I do rails -v I get:
rails -v
/Library/Ruby/Site/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem rails (>= 0) (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems.rb:214:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1082:in `gem'
from /usr/bin/rails:18
Older versions of rvm had a bug that can cause your ruby versions to get crosswired because the OS can cache executable paths for the which command (particularly if you are using zsh). See this long, detailed, mind blowing post by Yehuda Katz on the subject.
What I had to do this morning:
rvm update && rvm reload # update rvm
rvm gemset delete rails3 # delete old gemset
rvm install 1.9.2
rvm use 1.9.2
rvm gemset create rails3
rvm use 1.9.2#rails3
which ruby # check to be sure the ruby interpretter is properly set to 1.9.2
hash -r # if ruby interpretter is not pointing to 1.9.2
gem install rails
which rails # check to be sure we are using rvm version of rails
Note: On newer versions of rvm, you will have to use rvm get stable instead of rvm update
You don't need to use sudo when installing gems with rvm. If you follow the directions here to get RVM installed, you should be able to just do rvm use 1.9.2; gem install rails --version 3.0.0.
You don't have to specify version 3. If you have 1.9.2-p0, it will automatically get rails 3 when you rvm gem install rails 3. note: no sudo. I think when you use sudo it makes it use the system-installed ruby. If you think you need sudo, use rvmsudo.
Things probably got messy because you were following guides based on the pre-stable release of rails, which involved many other things. If you like, you can try uninstalling rvm and re-doing everything. It really isn't all that difficult.
Remember, you need 1.9.2, 1.9.1 won't work.
curl -O http://rvm.beginrescueend.com/releases/rvm-install-head
sh rvm-install-head
rvm install 1.9.2-p0
# also remember to edit your bash profile and add the required lines
# verify that 1.9.2-p0 shows up there
rvm list
# makes it so you're using it, and sets it as the default
rvm use 1.9.2-p0 --default
# verify this happened. should have => 1.9.2-p0 in the list
rvm list
# verify the version
ruby --version
# should automatically get 3.0
# `rvm gem install` installs it for every single installed ruby version
# in my experience
gem install rails
When you did rvm gem install, I think it installs it for every ruby version you have registered with rvm (at least it happened in my experience), so my assumption is that it was trying to force install rails 3 for an older ruby installation, which was missing the required gems.
Take it easy, not many commands are required. If you find yourself having to do 'hacks' or workarounds, then you're doing it wrong. Thankfully it's easy to start over. To remove rvm, just do rm -rfv ~/.rvm and also rm ~/.rvmrc if it's there.
Let me know how it goes.
working through this myself as new user mac osx blah blah
seems like a cache directory doesn't get made, try
mkdir $HOME/.rvm/gems/cache
so far so good after that...
I am running into the same problem (tried uninstalling and installing like Blaenk suggested)
rvm -v
rvm 1.0.2 by Wayne E. Seguin (wayneeseguin#gmail.com) [http://rvm.beginrescueend.com/]
ruby -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0]
gem install rails
ERROR: While executing gem ... (Errno::ENOENT)
No such file or directory - /Users/pragnesh/.rvm/gems/ruby-1.9.2-p0/cache/activesupport-3.0.0.gem
After doing "rvm update && rvm reload" rvm got updated to 1.04 (instead of 1.02 which I got via the recommended GIT install yesterday!?) it worked nicely.
The solution worked for me, with a few tweeks:
Instead of using rvm update, I had to use rvm rubygems. Then, after doing all the work from post 2, I had to execute bundle install and I entered rvm use 1.9.2#rails3 to my .rvmrc file. Everything now works like a charm, even when starting a new shell or terminal session. The full list of commands I used is:
>> NEW >> rvm rubygems
rvm reload # update rvm
rvm gemset delete rails3 # delete old gemset
rvm install 1.9.2
rvm use 1.9.2
rvm gemset create rails3
rvm use 1.9.2#rails3
which ruby # check to be sure the ruby interpretter is properly set to 1.9.2
>> DID NOT NEED >> hash -r # if ruby interpretter is not pointing to 1.9.2
gem install rails
which rails # check to be sure we are using rvm version of rails
>> NEW >> bundle install
>> NEW >> cat 'rvm use 1.9.2#rails3' > .rvmrc
Followed these instructions, and found them very useful for rvm installation. Hope they work for you.
http://adventuresincoding.com/2010/01/taking-the-helm-of-ruby-with-ruby-version-manager/
Doing this after the rvm update and reload worked for me:
rm -rf .bundle && bundle install
I can't install ruby 1.9.1. I tried installing macports, homebrew, and RVM. I installed macports but somehow when I used the commands it didn't work. Installing homebrew was a problem in of itself. Ditto for RVM.
Can anyone provide step by step instructions on how to do this on a mac leopard.
Geez, didn't think it would be this difficult.
I highly recommend figuring out RVM because switching back and forth between different versions of Ruby (and Rails) is a breeze.
If you installed Macports correctly, RVM should be easy to install with the following commands:
$ sudo gem install rvm
$ rvm-install
If you are having issues with MacPorts, check and see if your PATH is set up properly. I had to add this line to the top of my .bash_profile file (which is a hidden file in my home directory):
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
You can read more here: http://guide.macports.org/#installing.shell
Once MacPorts and RVM are installed, you can add versions of Ruby like so:
$rvm install 1.9.2-head
$rvm install 1.8.7
I didn't install 1.9.1 but it's probably '$rvm install 1.9.1'. Remember not to use 'sudo' to install ruby after you've installed RVM.
Dan Benjamin's ruby installation instructions helped me.