I am following a tutorial about Ruby on Rails, and the tutorial got updated to a new version of Rails, so I can't follow it anymore because I have an older version.
I would like to start new and uninstall Ruby on Rails and any related software on my Mac OS X 10.5.8, and follow it from ground up. If anyone would be willing to help me uninstall Ruby and Ruby on Rails, it would be much appreciated.
Download RVM or RBENV and upgrade to the latest Ruby (2.3.0 at this point). Don't touch your system Ruby.
Are you uninstalling Ruby on Rails, or Ruby AND Ruby on Rails?
If you want to uninstall Ruby on Rails it should be a simple matter of using gem uninstall rails or doing gem dependency rails and then gem uninstall for each of the listed gems that Rails depends on. If you installed them system-wide, using sudo originally, you'll have to use sudo again to uninstall them.
If you want to uninstall a system-wide Ruby you installed from source, well, I'd probably leave it alone and install any new versions of Ruby using RVM. The older version won't be visible to apps unless you want them to see it or set your path to include it. RVM's version will be found first unless you do rvm system.
Actually you could simply install RVM and have it install your new versions of Ruby, then from there install new versions of Rails, without even bothering to uninstall the old stuff. RVM really is that cool.
Related
I am using Ruby 1.9.3p2 and Rails 4.0 versions on my Linux machine.
Recently we got an maintenance project which is on versions Ruby 1.8.7 and Rails 2.3.2.
I tried of installing rvm, after that it asked to install ree. But it goes on continuously increasing packages to install.
Please tell me if there is any way without using rvm.
Using a version manager is the best way. If you don't want to use rvm, you could try using rbenv, although I prefer rvm.
I'm a little confused on using Ruby Version Manager. I was just wondering how to handle ruby updates for my web apps.
For example, I start a new Rails project and I tell RVM to use a specific version of Ruby like so:
rvm use ruby-2.0.0#my-project-name --create
Then say months down the road a new version of Ruby is released. What do I do then? Do I go back in and tell RVM to use the newer version? I want to build something that is always using the latest version of Ruby.
I'm assuming people build Rails apps, but don't always update to the newest version of Ruby and Rails?
Thanks, just starting out with all this, and trying to wrap my head around it.
There are three parts in this, Ruby, Gems and Rails Project, RVM can help organize everything in this order Ruby Interpreter/Version -> Gemset -> Rails Project
First Ruby:
You can use rvm list known to list all Ruby versions available in MRI, Rubinius, JRuby and others, after that you can install any version and interpreter like:
If you use MRI then rvm install 2.1 will install the latest in the 2.1 branch (2.1.1 being the latest).
For Rubinius rvm install rbx will install the latest stable Rubinius.
For JRuby rvm install jruby will install the latest stable JRuby.
After installing the version you're going to use, you need to specify that you're going to use it, like this for Rubinius: rvm rbx.
Second Gemset:
RVM gives you the ability to define different gemsets in each installed Ruby version that allows you to install gems for a specific project. For this Rubinius version I can:
Create a gemset like rvm gemset create latestRails.
Use a gemset rvm rbx#latestRails.
Show current Ruby/gemset rvm current.
Install latest Rails version in this gemset gem install rails.
Third Rails:
To keep Rails updated, you can use Bundler with a command like bundle update to keep all the gems updated (this are updated inside the current Ruby/gemset and the Gemfile) or a list/single gem of the project, for more info see "Bundle Update Documentation".
I hope I could help you.
I recently started learning Rails using Ruby 1.9.3p385, and I'm trying to develop a small project with it.
I'm using Linux so I installed Ruby using RVM.
I developed a few pages, following some tutorials. I would like to upgrade my project to use Ruby 2.0.0. What do I have to do?
I installed Ruby 2.0.0 with RVM:
rvm install 2.0.0
Everything seems OK, so I tried to use it:
rvm use 2.0.0-p247
But when I try to run my Rails server using rails server, I get the following message:
bash: rails : command not found
I've read the RVM documentation about upgrading Ruby but I don't really understand what it does; I'm afraid of breaking everything.
Does it will upgrade my project in a way it will use Ruby 2.0.0 or what should I do?
Next, I will want to upgrade also to Rails v4.
Your gemset which comes with new Ruby version is empty. Try this:
gem install bundler # this will install bundler
bundle # this will use bundler to install required gems
rails server
Did you run rvm use 2.0.0-p247 or did you use rvm use 2.0.0-p247 --default? The later will set Ruby v.2.0 as the default for your system. Failure to do that will revert your Ruby to whatever RVM's default is the next time you log into your system or open a new terminal window.
When RVM installs a new version of Ruby, it installs only the default gems. It CAN upgrade a Ruby to another version, and optionally install the existing gems as it does so, but that's not what you asked it to do: rvm install 2.0.0 only installs Ruby. At that point you have to install the other gems you need, which would include Rails.
My general practice when installing various versions of Ruby and the gems I like is to use two command-line pipes to dump my existing gems, then (re)install them. First I switch to an existing Ruby whose gems I want to duplicate, then run:
gem list | cut -f1 -d' ' > ~/gem_list
Then I switch to the newly installed one, and run this:
xargs gem install < ~/gem_list
This does a completely clean install of the gems, outside of RVM's commands.
Why? Habit. Paranoia based on some "experiences" I had in the past with RVM.
Once that's all done and I have brand-spanking-new Ruby and gems, I'll proceed with running bundler or other housekeeping chores.
when you install a new ruby version, you have to reinstall all the gems for that version. start of by installing bundler first. Then run bundle in your rails root directory. When you encounter no errors, you're good to start the rails server. Good luck!
run bundle install on the application root, you need to reinstall all your dependencies for the new version of Ruby.
I just installed Rails on OSX. I used the stock version of Ruby and followed the following procedure:
Installed newest version of RubyGems
Ran sudo gem install rails --include-dependencies
Installed Mongrel using sudo gem install mongrel --include-dependencies
Rails is working just fine, but more reading led me to this setup guide:
http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx
This is essentially the exact same install I performed, except he compiles it from source code and installs to /usr/local -- I really like this idea, since it keeps the OSX install stock and confines all my dev stuff to one area.
So, assuming I want to follow these instructions, what do I need to do to revert my system back to "stock" ruby? Can I just uninstall the Rails and Mongrel gems? Will the upgraded RubyGems cause any issues?
Basically, my concern is that some other software unrelated to my development work will need to use OSX's stock Ruby, and I will have screwed it up somehow. Any advice to undo the 3 steps I listed above and get as close to stock as possible would be appreciated.
Thanks!
The article you are referring to is over three years old (which is outdated in the Rails community). My recommendation is:
Install XCode
Install Homebrew
Install MySQL, Postgres, Image Magick, etc. (brew install mysql, etc.)
Install RVM
Install Ruby 1.9.2 (rvm install 1.9.2)
Switch to default (rvm 1.9.2 --default)
Install Rails (gem install rails)
Install Passenger (gem install passenger)
Each step will have a few more substeps but you should be able to look them up or be promted with them.
I can't remember why I did this but I do know that it worked and has caused no problems since. I moved /Library/Ruby to /Library/Ruby.broken and then installed Ruby from source into /usr/local.
There's something fundamentally missing with the stock Ruby in OSX. I wish I could remember what that was.
I've just gone to installed RoR on my snow leopard mac.. and found the rails gem was already installed..
is this normal? Does it need updating?
Does this get installed along with textmate?
It is installed with the Snow Leopard developer tools. Version 1.8.7 of Ruby is installed.
You should be fine for most your development needs. If you wish to upgrade just update the gems:
$ sudo gem install rubygems-update
$ sudo update_rubygems
$ sudo gem update
$ sudo gem update --system
$ sudo gem install rails
I found an incredibly well written install guide at The Pragmatic Studio called Installing Ruby 1.9 and Rails 3 on Mac OS X. It took about an hour to follow, including installing several prerequisites.
I'm hesitant to mess too much with OSX's native installation of ruby/rails, lest things get broken by an Apple system update, so I was very excited to learn about RVM (Ruby Version Manager) which is a cool tool for switching between different ruby/rails installations. The Pragmatic Studio tutorial walks you through installing rvm.
There are a few glitches with the guide, which I'll list here:
Git: I just installed git itself. You do not need to set up a github account.
Git: You may need to manually add /usr/local/git/bin to your PATH. (They don't explicitly tell you to)
RVM: The protocol for the rvm-install-head URL should be https, not http
RVM: The installer complained a lot, but it worked anyway.
RVM: The newly installed ruby 1.9.2 didn't activate until I ran 'rvm 1.9.2' in step 8
All told, this seems like a GREAT approach, and I'm really impressed with their install guide!
Yes, the rails gem is already installed along with Snow Leopard, because you installed developer tools, it's very normal.
But it's a little bit old, you need to update it.
TextMate did not bundle any RoR stuff with this. TextMate just included a lot of bundles which mainly consists of Python and Ruby scripts, if you do not have ruby, textmate will not work.
However, TextMate is originally made on Tiger 10.4, which bundled Ruby 1.8.2, and Snow Leopard bundled Ruby 1.8.7, so TextMate's bundles is not fully compatible with Snow Leopard
Refer to this and get some fix for these issues:
http://wiki.macromates.com/Troubleshooting/SnowLeopard
And also make sure you always keep your RoR bundle to the latest SVN is also a good habit
TextMate is just a text editor. It only understands Rails syntax and file structure making it easy to write Rails apps. That said, you still need to install Rails separately to create Rails apps.
well for me it worked this... I have mountain lion but it worked just fine...