How do I upgrade my Ruby version in Windows using Instant Rails? - ruby-on-rails

If I'm using Instant Rails, how do I upgrade my Ruby version from 1.8.6 to 1.9.* which they say runs faster in Windows? What's the necessary Instant Rails console command? Thanks.

Here's an alternative to consider.
You could just install ruby 1.9.2 (1.9.1 segfaults with Rails3 and isn't recommended ... make sure to install it to a different folder like c:\ruby192 or something) then use pik http://github.com/vertiginous/pik to switch the ruby version you're running.
I bet that would work just fine. Keep in mind that you'd have to install all your gems again though.

Related

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

How to configure Rails to use different version of Ruby?

I'm trying to deploy my Rails 3.0.1 application which works with Ruby 1.9.2.
However, I noticed that Rails 1.8.7 is installed on the server.
What steps should I take to install Ruby 1.9.2 on the server, and force my application to use it ?
I use Apache and Passenger.
I would recommend installing RVM and using that to set the version of Ruby that you want on the server.
Here's a rundown of its advantages in a production environment:
RVM allows users to deploy each
project with its own completely
self-contained and dedicated
environment--from the specific version
of ruby all the way down to the
precise set of required gems to run
the application. Having a precise set
of gems also avoids the issue of
version conflicts between projects,
causing difficult-to-trace errors and
hours of hair loss. With RVM, NO OTHER
GEMS than those required are
installed. This makes working with
multiple complex applications where
each has a long list of gem
dependencies efficient. RVM allows us
to easily test gem upgrades by
switching to a new clean set of gems
to test with while leaving our
original set intact. It is flexible
enough to even have a set of gems per
environment or development branch--or
even individual developer's taste!
It's very easy to setup and use, especially compared to managing the Ruby versions yourself. I've done both and I prefer RVM much more now. Once you have RVM installed, using Ruby 1.9.2 is as easy as:
rvm install 1.9.2
rvm use 1.9.2
And then you can check which version of Ruby your production environment is using with:
ruby -v
Assuming you use Apache, reinstall Passenger with
$ passenger-install-apache2-module
while having Ruby 1.9.2 active. If you use RVM just type rvm use 1.9.2 to make that version of Ruby active. Follow the on-screen instructions for how to modify your httpd.conf.

manually compiling ruby 1.8.7 on ubuntu hardy

running two rails 2.3.8 apps on two virtual servers in ubuntu 8.04 with apache and passenger. the ruby version is 1.8.6
we are upgrading one of the apps to rails 3.0.4. my understanding is that we need ruby 1.8.7 to run the app. with this version of ubuntu we will need to compile ruby 1.8.7 manually.
never compiled manually before. if you know of any resources i should check out that would be great.
i have not been able to determine the version of passenger and am trying to make sure it will be compatible with rails 3.0.4. any suggestions?
the application we are leaving in 2.3.8 is our core business application and i need to make sure i don't mess it up.
Thanks!
Just use RVM. Almost everybody use it now.
Early Passenger versions for Apache had some bugs so my suggestion is to simply upgrade Passenger to the newest version.

Ruby on Rails: using rails 2.3.x and 3.0 on same machine

I just finished a project with rails 2.3.8. Client won't pay for the migration, so I want to keep it as is.
I want to start a new project, which is to build my own homepage. Want to use similar tools but want to go to rails 3.0.
Can these versions co-exist on the same machine? If yes, what do I need to do? Found few pages online, but not sure they are up-to-date (e.g. about rails 3 beta and rvm).
I'm using rvm and running 2.3.9 on ruby 1.8.7 and 3.0.1 on ruby 1.9.2 and it works quite well. I followed http://rvm.beginrescueend.com/rvm/install/ to get rvm installed and then switched to it with:
rvm use 1.9.2
Then you can install Rails 3 on that rvm, set up your new project and switch back to your system ruby and older rails when you need to with:
rvm use system
It's been a really great way of switching back/forth for me.
Make R3 the default for your system. Then freeze rake rails:freeze:edge RELEASE=2.3.8 applications if you need to develop with old versions
With rvm you can also use different gemsets with the same ruby installation:
http://rvm.io/gemsets/basics/

Ruby on Rails - Locomotive for version 2.3.8 -- is there such a thing?

I am looking for a piece of software that will allow me to use Ruby on Rails 2.3.8 on top of MACOSX - basically, I teach at a college where students are not able to get terminal acccess to the rails built into OSX so I am looking for a piece of software like "Locomotive" that is an app that allows students to use rails without administrator access to the computer itself.
Any one have any ideas?
We will be using Rails 2.3.8
thanks.
I encourage you to teach 3.0, but each to their own. If your materials only cover 2.3.8 then it's missing out on a lot of goodies associated with 3.0 (such as Bundler). Anyway:
My primary fear with this is that you're going to have an un-upgradable version of Rubygems if you don't have system privileges. Some gems require a Rubygems version >= 1.3.5 or even better, 1.3.6. Latest is 1.3.7. Thankfully, there's a way around it.
You can do this by installing the rvm gem:
gem install rvm --install-dir ~/.gems
RVM is "Ruby Version Manager" and does what it says on the tin: manages different versions of Ruby on your system. It'd be helpful in your case because it works without modifying the system Ruby.
This will install the gem to the user's home directory rather than the default system path. Then you'll need to run the rvm-install command which, as of this writing is:
~/.gems/rvm-1.0.14/bin/rvm-install
Your version of RVM may be different. To install a new version of Ruby which people can (ab)use run:
rvm install ruby-1.9.2-p0
1.9.2 is the latest stable version of Ruby and I highly encourage you use it rather than the older 1.8.7.
This should come with the latest Rubygems and, for bonus points, won't muddle about with the existing ruby installation on the machine (which is probably impossible if you don't have admin rights).
From this point, you'll be able to use
rvm use ruby-1.9.2-p0
to "switch" to that specific ruby. From there, you'll be able to do run gem install rails -v 2.3.8 which will install Rails somewhere in ~/.rvm. The location is not important. What is important however is that now you'll have a rails command that you can use and then you can go from there.
Good luck!

Resources