I'm trying to learn Ruby on Rails for last 4 month. But Problem is whenever i got time my all time got waste to try to install it in my Mac Machine. It's easy to install in window only by a single installer. But in mac i try many combination of Ruby and Rails versions. But not able to run it. Always getting different types of errors like 'Could not find gem sqlite3-ruby (>= 0) ruby' or Bundle installer, etc.
I know this types of problem is discussed in many forms. I follow many of them but problem is still there. Can someone please give me a permanent solution of my problem.
RVM is your friend :)
Just one command to install Ruby, Rails both :)
curl -L https://get.rvm.io | bash -s stable --rails
Optional other things:
You may want to see JewelryBox
I wrote an article on this a few months back. Everything should still be relevant. http://matthalliday.ca/weblog/entry/setting-up-a-ruby-on-rails-environment
Related
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
This is my first question please be nice.
I've been trying to get my hands dirty with ruby/rails for a small coding project. I have Mountain Lion, and have been trying to use various techniques i've found on stackoverflow, and across the interwebs. It's not going so great! Nothing works of course. I have the system version of Ruby (1.8.7) as of now, and a bunch of broken junk from trying and failing to install Ruby!
When I install Rails via gem install, it sat for awhile... I finally learned to use -V, and noticed everything was returning back 302, and this takes forever, and finally it installs -- I get this output when I try to run rails -v
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:230:in `activate': can't activate rack (~> 1.4.5, runtime) for ["actionpack-3.2.13", "railties-3.2.13"], already activated rack-1.5.2 for ["rack-ssl-1.3.3", "railties-3.2.13"] (Gem::LoadError)
It looks like some dependencies are broken? Anyhow I'm now trying to use RVM now to get another version of ruby and setup grails with brew, This is telling me that I need a newer version of ruby to install anything pretty much?? Here is the output.
rvm install 1.9.2-head
Installing requirements for osx, might require sudo password.
Skipping brew update make sure your formulas are up to date.
Cowardly refusing to continue, please read 'rvm autolibs'.
To proceed rvm requires a ruby-1.9|ruby-2 compatible ruby is installed.
We attempted to install ruby automatically but it failed.
Please install it manually (or a compatible alternative) to proceed.
-- I am getting os frustrated here, please throw me a bone and help me out --- If I have to have to I'll setup a linux vm just to get rails running -- yet I prefer working on my mac.
Please any advice?? I just want a working version of Rails 3 on my Mac this is allThanks in advance
Please go through www.railsinstaller.org for detailed installation and setup process. This guide should answer all of your questions.
Have you tried this tutorial http://net.tutsplus.com/tutorials/ruby/how-to-install-ruby-on-a-mac/
The tutorial includes all the errors you may come across during the installation.
According to this tutorial Ruby on Rail comes with the mac out of the box.
Have you tried JewelryBox? It provides a painless install method for rvm and a great little gui that helps you monitor the size of your gem sets, and installs of ruby. Along with helpful reminders to upgrade rvm. I resisted at first using it, because using a GUI made me feel like a noob, but it really is a great little tool, that makes for super easy installs of ruby, and rvm, and consequently rails.
http://jewelrybox.unfiniti.com/
I ran the railsinstaller from railsinstaller.org on my OS X 10.7.5, then ran into a few issues with RVM:
1) First, I got "RVM: command not found". So I created the .bash_profile and added
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
2) Restarted the terminal, but still getting the same error message. I checked the .rvm folder to see if it's properly installed; it seems to be missing the "scripts" folder. So I ran
\curl -L https://get.rvm.io | bash -s stable
3) Then I get this:
Launch of "gtar" failed: the PowerPC architecture is no longer supported. Could not extract RVM sources.
Base on my research, this means that I need an Intel 64-bit machine. But I double checked and that is indeed what I have (Intel Core Duo 2). I've been spending hours trying to find more relevant documentations but to no avail, so I'm really stuck as I need the RVM for my projects.
I would really appreciate any help! Thank you!
In my research it appears that Jewelry Box does not support newer versions of RVM. I don't actually know if this is the issue that you're running into, but it seems likely. I'd recommend uninstalling Jewelry Box and reinstalling RVM.
To reinstall RVM, you'll need to completely remove RVM and then use the same string you used before, but this time add --rails at the end, so you get rails as well.
\curl -L https://get.rvm.io | bash -s stable --rails
The other parts of rails installer should still be there like git and sm.
Jewelry Box will no longer be useful, but for that I highly recommend getting to know Bundler. The de facto standard for working with ruby gems. It'll be more useful when using rails and will be less likely to run into dependency issues.
Welcome Rails as well, stick with it and you'll be a pro in no time. I highly recommend taking a look at Rails Casts. Very good short and digestable videos tutorials for rails.
Hope that helps.
I guess I messed things up a little bit:
I wanted to play around with Ruby on Rails a little bit. I installed it a year ago but never used it. Till now.
Because of some problem a ran into I wanted to start from beginning with a fresh install. I uninstalled the Rails gems (3.0.7 and 3.1.1) and followed this guide for a fresh install: http://eddorre.com/posts/rails-ultimate-install-guide-on-os-x-snow-leopard-using-rvm-homebrew-and-passenger
But now gem does nothing - when I type gem install bundle in my terminal the cursor goes straight to the next line. Even gem list or gem --help doesn't work. I get no error messages.
I have no clue what happened. Some thoughts?
I'll do a full reinstall of rvm:
rvm implode
and start again:
bash <<(curl -s https://rvm.beginrescueend.com/install/rvm)
If you try to recover the existing environment, there are some options to rvm that can be useful:
debug - show info plus additional information for common issues
upgrade - Lets you upgrade from one version of a ruby to another,
including
migrating your gemsets semi-automatically.
cleanup - Lets you remove stale source folders / archives and
other miscellaneous
data associated with rvm. repair - Lets you repair parts of your environment e.g. wrappers, env files and
and similar files (e.g. general maintenance).
Since you're trying to start over anyway, I would highly recommend that you use RVM. Do the "single user install" and these gem problems should disappear entirely. Then if you get a specific error message, post that so we have something to go on.
Please run this command in your console:
gem env
This command will return your gem environment, and one more correction: I guess it should be 'gem install bundler' not 'gem install bundle'.
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.