So first off, this is my first post on stackoverflow, so take it easy on me ;)
I'm a new Fedora user (f20) and I'm still in the early stages of getting used to linux. I tried to install Ruby on Rails (newest Ruby—2.1.1—and newest rails—4.1.0), using several guides I found online, which required for me to download and install several other packages. Several errors occurred towards the end of my installation so I thought I'd uninstall it and start from scratch using RVM which I hadn't done in the first place.
I tried removing the gems I installed using gem uninstall [gem_name] but I wasn't having any luck with many of them. So I decided to just sudo yum remove ruby in the hopes it would remove everything I had installed, but to my dismay the directory /usr/share/ruby still exists which makes me think that my uninstallation was incomplete.
Is there some why to completely remove any shred of ruby, rails, and gems from my computer so I can reinstall ruby on rails? Is it even necessary for me to do so in order to install a lower version of ruby (2.1.0)?
Thanks in advance.
Ok, after reading the comments I figured out the problem!
I ran a yum list | grep ruby and similar searches and found that I had not, contrary to what I believed, removed all the packages I had installed. After deleting the remaining packages my usr/share/ruby folder vanished to the sound of my yipee's!
Thanks
Related
So I wish I had known far before that installing Rails with sudo was a bad thing. In fact, after doing my research, it appears that most people would agree that installing any type of package manager as sudo is a big no-no.
Unfortunately for me, I found this out a bit too late. I have several Rails applications that I have created and I am worried that If I try to reinstall Rails with RVM that my applications will not work because of dependency issues.
When I would install gems with bundle install, if the gem was new, Rails would ask for my password before installing it. I did not think much of it at the time, but now, I am worried nothing will work after I try booting a Rails app.
So my questions are:
If I installed Rails with sudo, will my applications still work if I reinstalled it under RVM?
If they don't work, what would I need to make them function correctly?
How do I remove a Rails installation that was installed with sudo?
Is this issue as severe as I think it is?
I had seen a lot of related posts about why one should not use sudo to install gems and Rails in general, as well as why not to do it with RVM, and pretty much not to do it all with anything Ruby related. But I have not seen a post that really addresses any of my concerns and questions that I mentioned above.
No it's not severe as you think. Applications are meant to be portable (somewhat), once you have the same dependencies installed as your development machine, they are meant to work again otherwise you wouldn't be able to deploy.
Now the main thing to check is that all your files in your rails applications are owned by user and not by sudo (otherwise you won't be able to read them later on).
Aside from it, you can simply install rvm, ensure with which ruby and which gem comes from rvm and not from your packaged ruby installation (which you can remove, I do this usually) and then simply run bundle install in your rails application, at that point they are ready to start again.
I used http://railsinstaller.org/ to install a bunch of packages. Then I created a rails app by calling rails new myApp and then rails serverbut unfortunately I got this error: Click Here
So I think I would just rather remove rubinius or do some sort of clean install of ruby and all it's dependencies but that might be an issue because I might accidentally delete some files and not remember what they were.
Thanks for the help.
The Ruby installer installs RVM for you, which then installs and manages each Ruby for you, so to remove it, at a command line, use:
rvm remove rbx-1.10.2
Further instructions can be found on the RVM site:
https://rvm.io/rubies/removing/
To add a new Rubinius:
rvm install rbx
See https://rvm.io/rubies/installing/ for more.
I am trying very hard to uninstall Ruby and Gem from my computer so that I can do a complete reinstall of all, since I've clogged up a few errors and crossed wires.
When I do sudo uninstall gem I get the following progress/message:
Preparing Uninstall...
Uninstall Began...
Uninstall Failed...
Reason: ErrorMissingBundle
I'm NOT, I repeat NOT at this point looking to install rvm, since I just want to clean out my computer and get rid of the bugs before I install anything else.
You didn't say how far you had gotten in the process, but all you have to do is remove the Ruby directory (grep for it) and the gems will go away with it. You'll probably have to update your paths as well.
But, you really should use RVM. If you install it correctly those errors you see will not affect you because you will be using the RVM installed Ruby and gems. Also, the system installed Ruby is sometimes used in apps and if you remove it you could break those apps.
More information in this previous question.
I've recently started teaching myself Ruby on Rails, and it's all going well except I'm looking to completely reinstall Ruby, Rails and Gem.
I think I got a bit too excited at some point and deleted/modified some files or folders I shouldn't have, so I just want to get my system back to its original state so that I can reinstall the necessary Ruby, Rails and Gem bits.
I've read in places that I can install something called rvm to do this, but right now I just want to keep my system as simple as possible so that my understanding can keep up.
Any help would be appreciated.
Many thanks.
You list all the gems which are installed in your user account, with:
gem list
You can then delete any of the gems, by doing this:
gem uninstall GemName
... until gem list doesn't show any installed gems.
After that, everything should be as good as new.
I would highly recommend to install RVM, because it will help you not to get into the same situation in the future. With RVM you can create "gemsets" to keep the gems for each project separate from other projects.
With RVM you can also install different versions of Ruby, such as the newer Ruby 1.9.2
Check it out! It's really not difficult to install
http://beginrescueend.com/
Check these RailsCasts:
http://railscasts.com/episodes/200-rails-3-beta-and-rvm
http://railscasts.com/episodes/201-bundler
If you are on Max OSX 10.5 and up, Ruby and RubyGems is installed with Developer Tools.
On older versions you could uninstall by running this command:
$ sudo perl /Developer/Tools/uninstall-devtools.pl
Then you just need to reboot your computer and install Developer Tools again. After that if you want to use RVM follow the instructions here. There are also some OSX specific options you should go over as well.
You could follow the instructions on the RoR site - the download page also includes instructions. Another option is this one click installer from the Ruby OS X project on SourceForge.
If you have a TimeMachine backup available, you could also choose to restore your deleted files instead of reinstalling.
The simplest way is to use rvm to do this. The advantage to this is that everything's installed in a manner that's specifically isolated from the system.
Using the OS or MacPorts/Homebrew provided Ruby is a great way to get going, but it doesn't scale. For the long-haul, it's best to use rvm because it is easier to stay up to date, to install different versions of Ruby, and to switch back and forth with a minimum of pain.
Plus, if you really get sideways you can always rvm implode and start over, which when combined with bundler will make life pretty easy.
So I was following the steps on Hivelogic to get ruby on rails setup on my machine. After compiling and installing, I used the which ruby command to double check it installed in the right place. It did not. I was able to install the Rails and MySQL gems though, but both POW and localhost:3000 don't work.
Is there anything wrong with having it in the usr/bin directory instead of usr/local/bin? My usr/local/bin is practically empty, but usr/bin has a ton of files in it.
Edit: I reinstalled ruby to usr/local/bin but now Rails won't install. Is it a problem that it's already installed in usr/bin?
That page is a few years old. The current best practice for Mac and Linux is to use rvm. You can see, even Hivelogic uses rvm now (though I'm not sure how I feel about installing it system wide).
Anything that recommends installing from source as the first option instead of a last-resort fallback is probably bad advice. It's better to install using a package manager like MacPorts or Homebrew both of which have current versions of Ruby 1.8 and 1.9.
MacPorts installs everything in /opt specifically to avoid conflict with system files. From time to time Apple will distribute an update that patches ruby and this can mess up anything you have in the way of dependencies if you've been using a modified /usr/bin/ruby. Generally the system ruby is supposed to be left as-is.
You can replace the "compile ruby" step with an installer like that and save yourself a lot of trouble in the future. Just be sure to have /opt/local/bin as one of the first items in your PATH just as you would for other solutions.
Since installing Ruby and Rails and some kind of database can be a confusing process, it seems like there should be a meta-installer to help you through the process.
So I finally managed to get rails installed in the correct spot. I had to change the line in my .profile to export PATH="/usr/local/bin:$PATH" and then do a sudo gem update --system after installing rubygems before rails could actually be installed.
RVM and Homebrew did not help at all.
EDIT: Since people have a problem with this answer, I'm giving an update. I have since installed RVM and am liking it, but only because I have a friend I ask all my questions to, as RVM is really confusing if you're not used to doing a lot on the command line. I needed help from him to install it because I didn't have any of the bash files, and thought they were hiding somewhere. If you're missing the bash files, just create them yourself. This took a long time to get working, but now I apparently have it setup right.