If I have bundler do I still need rvm for Rails 3 applications in production?
I'm not pretend to have many ruby version running
You don't need RVM if you are happy with Ruby version bundled with your production server OS.
However Linux distributions usually have old, not patched versions of Ruby. So I suggest to install RVM, this is quite easy to do, and install newest patched Ruby version.
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 am using windows for rails.I installed pik for maintaining different versions of ruby.
But is there any possibility to create gemsets in PIK as in RVM?If not then how can i install different versions of rails?
Please help me..Thanks in advance!!!
Pik saved my life. I've been using rails 2.3.8 at work. I wanted to try the new rails 3.1 for my personal use. They told me to install RailsInstaller. But that screwed up all my rails 2.3.8 settings. So here's what I did.
I went to rubyinstaller. Downloaded installer for versions Ruby 1.8.7-p302 and Ruby 1.9.2-p290 installed them.
I installed both versions of ruby
then i installed the gem pik (see https://github.com/vertiginous/pik)
Now, I can switch between Ruby 1.8.7 and 1.9.2 using pik easily
pik 187 (switches to ruby 1.8.7)
So, I switched to ruby 1.8.7. and then installed rails 2.3.8
gem install rails -v 2.3.8
then i said pik 192 which switched the ruby to 1.9.2. Then i said
gem install rails -v 3.1.0
Now to use rails 2.3.8 all I have to do is say pik 187. Not only it switches ruby to 1.8.7 it also switches rails to 2.3.8
I am not a Ruby or Rails expert. But the key to remember is that you need to have the right Ruby version selected while installing rails. Meaning, if you're installing rails 3.1.0 make sure your current ruby version is 1.9.2 or higher or whatever version rails 3 works on. Similarly if you want to install rails 2.3.8 make sure your current ruby version is 1.8.7
Hope this helps. And people won't lose sleep because of this, like i did.
As far as I know, pik doesn't have this feature (yet).
As PIK is no longer maintained, see this commit comment. I would suggest to checkout URU to have version support in Windows (also supports linux and OSX)
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.
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...