Trying to get Ruby/Rails installed on OSX Mountain Lion - ruby-on-rails

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/

Related

I need to start over with a fresh, ground zero, install of Rails. How do I do that?

Running Mac OS X Mavericks, I have completely jacked up my Rails installation to the point that I am unable to sort out what all is wrong. I'm working through the railsapps.org book on learning rails and am simply trying to set up the test environment so I can actually start learning... Anyway, I'm so messed up now that I really just need to flush it all and start over. I have reinstalled Rails, and now the default gemset is empty. I am unable to figure out at this point how to repopulate it with the default gems (uninstalling and reinstalling Rails did not do this for me).
At this point I'm so far down a rabbit hole that I'm unable to orientate myself, so I feel like I need to just resurface and start over from zero fresh. How would I go about resetting my environment such that I can do this? I assume I need to uninstall Rails, RVM, etc?
First, make sure you are running Mac OS X Mavericks (10.9).
Start by uninstalling Ruby, for example:
$ rvm remove ruby-2.1.1
More info is on the Removing Rubies page on the RVM site.
Then carefully follow the guide Install Ruby on Rails - Mac OS X Mavericks to install Ruby 2.1.1 and Rails 4.1.
If things don't look right, for example if RVM is giving error messages, you can escalate by uninstalling RVM itself. This will removes all Ruby installations RVM manages, and everything in ~/.rvm:
$ rvm implode
Follow the Install Ruby on Rails - Mac OS X Mavericks to reinstall RVM, Ruby 2.1.1 and Rails. Take notes as you go and if you encounter any difficulties, ask a new Stack Overflow question, supplying the exact error messages and conditions that created the error. Installing Rails is the biggest obstacle to learning Rails, so good luck, and I'm sure you will succeed with the help you find here.
Yes, my teammate had this issue on linux box. He had to completely wipe ALL rails installations. Re-download/install rails installer (http://railsinstaller.org/en) for whatever OS you are using. I dont know what IDE you use... but in our case we use Eclipse with aptana. Reinstall that too then link everything back together. Then in your IDE you should have option to make a default project by calling rails new blog(replace blog with whatever your project name would be) After which you should have fresh project to work with. Don't forget to do bundle install

Ruby On Rails Install

I've spent some time in web development and since I have decided that ruby is quite a nice language to code in I want to try the reason why some people say ruby got known : Rails
I installed rails in my linux machine however I am now trying to develop it in Windows. I know that it was recommended to install rails using RVM in linux however I'm not sure what is the best way to install it in Windows since I've read articles which said that
gem install rails
is a method which will cause you lots of bugs in both linux and windows
My question to you is what is a method which is "bugless" to install rails in windows?
Is
gem install rails
actually buggy?
Yeah, installing Rails on Windows is a little more complicated, but that's why they have bundles for it.
Go here and follow instructions.
http://railsinstaller.org/en

Completely reinstalling Ruby Rails and Gem on Mac OS X

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.

Ruby, RVM, LLVM and MySQL

I'm having big trouble in configuring Ruby and MySQL on MacOSX. Just a fact, I'm new on MacOSX and Ruby On Rails.
So, first I was having problems to install mysql2 gem, after get the gem installed I was trying developer a test, and when I tried start the WEBrick got this error saying that couldn't load a MySQL lib called "libmysqlclient.18.dylib". Googlin' about the error I saw that everyone was recommending using Ruby through RVM. I installed RVM and tried install ruby 1.9.3 and get this error:
ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read rvm requirements.
I'm almost giving up learn Rails, setup a development environment shouldn't be that painful. On Windows I got no problems.
Unfortunately, you're trying Rails at a bit of a bad time. There's a lot of transition at the moment, as others have mentioned Xcode 4.2 was recently released and has a new compiler, also Ruby 1.9.3 came out.
I've been developing Ruby and Rails for some years now, but trying to get up and running again after installing Lion clean this week has been more problematic than in the past.
First, make sure RVM is up to date (as the issue should be fixed):
rvm get head
Then try installing like so:
CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
EDIT:
Note, working through my own issues I believe the first command probably fixed the problem. The second wouldn't have provided any benefit over:
rvm install 1.9.3
As on my clean install, /usr/bin/gcc-4.2 doesn't exist.
Also I wanted to add that I ended up compiling the older GCC manually for those situations where the new compiler fails. I followed this very informative blog post.
add --with-gcc=clang as a parameter:
rvm install ruby-1.9.3 --with-gcc=clang
Did you install the latest Xcode from Mac Store?
here is a nice guide i followed to update my ruby/Rails to 1.9.2/3.0
guide
good luck
Part of the problem is that with Mac OS X 10.7 (Lion), Apple switched C compilers, and some things don't build well with the new (LLVM) compiler yet. See http://eddorre.com/posts/rails-ultimate-install-guide-on-os-x-lion-using-rvm-homebrew-and-pow for decent instructions (note: I haven't followed these exact instructions, but they're a pretty good summary of the things I did do to get Rails working on Lion).
Once you have the C compiler issue dealt with, everything else should be pretty effortless.
Bonus tip: avoid MySQL. PostgreSQL is better in nearly every respect.
Thanks Delamenko finally got it to work
SUMMARY FOR STACK OVERFLOW
I was trying to install SiriProxy on a clean Lion installation on Xcode from App Store
I kept getting errors like :
The provided CC(/usr/bin/gcc) is LLVM based.
bash-3.2$ rvm install 1.9.3
ERROR: The provided CC(/usr/bin/gcc) is LLVM based, it is not yet fully supported by ruby and gems, please read `rvm requirements`.
After 2 days finally got it working with these two lines
http://stackoverflow.com/questions/8000145/ruby-rvm-llvm-and-mysql
bash-3.2$ rvm get head
bash-3.2$ CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
Before that I had tried every stackoverflow article on Ruby and Lion so doing these may have done some setup that helped the above 2 steps work:
Things I tried included:
Running Install Xcode.app (I had downloaded from App Store - running this does futher installation)
Installing
https://github.com/kennethreitz/osx-gcc-installer/downloads may help for installing GCC.
Set up CC in
more /Users//.bash_profile
bash-3.2$ more /Users/<USERNAME>/.bash_profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function
export CC=/usr/share/TargetConfigs/bin/gcc
First line came from SiriProxy install instruction
https://github.com/plamoni/SiriProxy
2nd line export CC never seemed to work. So dont add.
It had many versions each pointing
I finally used CC=/usr/bin/gcc-4.2 rvm install 1.9.3 --enable-shared
See Arkku's answer - I tried everything here first, then did what he said and all is well.
As of Lion 10.7.3, Xcode 4.2 and Ruby 1.9.3p0 it's what works.

One-Click install for Ruby/Rails/SQLite?

I'm used to the One-Click install local environments of MAMP. Is there a Ruby equivalent... a download that you run and instantly get the most current versions of Ruby, Rails, SQLite running locally?
I'm using a Mac, running Leopard, and am aware that all of the aforementioned technologies ship with Leopard (except maybe SQLite). The books that I have reference newer versions and the last thing I need is to try to retrofit a tutorial to work with my version.
And one more less important question: What are "Gems" and is that something that I need to make sure is fully updated too?
Installation is pretty confusing when you first start with Rails! Even though a lot of what you need is already installed if you are using Mac, personally I found it really hard to find come concise information on how to best go about setting things up.
Since I didn't want anyone else to go through the headaches that I had when configuring their Mac development environment, I've written a 7 step guide to installing Ruby on Rails, MySQL, Apache with PHP, and phpMyAdmin on OSX Leopard. In short, everything you should need to get developing locally on your Mac!
Here's the link:
http://waavoo.com/2009/7-step-guide-installing-ruby-on-rails-mysql-apache-php-phpmyadmin-intel-mac-os-x-leopard/
Hope that helps!
Take a look at FiveRuns Install. It's a free Ruby on Rails stack that you can download.
RubyGems is the Ruby standard for publishing and managing third party libraries. Check out the User Guide.
Have fun!
I have no idea what mac os are you in but Leopard (10.5.x) already have ruby installed, all you need is to updated the gems using
gem update rails
in your command line.
if you're on Tiger (10.4.x) the installation is broken, and please follow this link.
You should also have a look at Phusion Passenger - this, along with the prefpane, allows you to have apache VirtualHosts set up the easy way.
Current versions of Rails are designed to work (for development) without needing an AMP -style stack, by using SQLite and a small Ruby Web server, so if you will only be doing Rails development you don't need to set up a stack - you can just type "rails" and it will work.
BUT the versions of RubyGems and Rails shipped with Leopard are now outdated, though, so you'll need to upgrade these before you go too far. There's an article that I wrote on setting up a Mac for development here, but the minimum commands go like this:
sudo gem install rubygems-update
sudo update_rubygems
sudo update_rubygems (yep, twice)
sudo gem update --system
These get RubyGems up to the current release, so that you can upgrade Rails safely. To do that, type:
gem update rails
The last command doesn't have sudo, because if you omit it, current versions of RubyGems will install a clean copy of the gems into your home directory, leaving the system versions untouched.
Finally, amend the .profile file in your home directory, so that the line with PATH in it says:
export PATH=$HOME/.gem/ruby/1.8/bin:$PATH
Close up any terminal windows for this to take effect. The utilities provided by the gem packages in your home directory will now have precedence over the system versions.
This means that you can type "rails" and the latest version will run, but you haven't messed with any of the software provided by Apple (apart from the system copy of RubyGems).
To upgrade your private copy of Rails whenever a new version comes along in future it's just this again:
gem update rails
just refer this....
http://wiki.rubyonrails.org/getting-started/installation/windows#installing_ruby_on_rails_on_windows
BitNami RubyStack is exactly what you are looking for http://bitnami.org/stack/rubystack

Resources