I have Mac OS X Snow leopard that has pre-installed Ruby 1.8.7 and Rails 3.0.1
I need to work with Redmine a bit that requires Rails 2.3.5
Is it possible to correctly downgrade my current rails 3.0.1 to rails 2.3.5?
You don't need to downgrade, RubyGems allow you to install multiple versions of the same library.
$ gem install rails -v 2.3.5
To avoid versioning hell, you can also use rvm, which allows you to install multiple ruby versions and "gemsets" on the same machine and switch between them.
Related
I just installed rails using the awesome rails installer for windows. Unfortunately there is not yet the option available to use the installer for Rails 5, what is the easiest way to upgrade on Windows? I currently have ruby version 2.2.4 and rails 4.2
Check this tutorial:
http://blog.teamtreehouse.com/installing-rails-5-windows
No need to update ruby, because 2.2.2+ versions support new Rails.
Actually you have to run
gem install rails --version 5.0.0
I used Jruby version 1.6.5.1 which include Ruby 1.8.7, rails 2.3.12. and gem 1.6.2.
How can I upgrade all this versions to higher versions (Jruby 1.7.x, ruby 1.9.x or 2.x and rails 3.x or 4.x)
Thanks in advance.
You can use rvm to manager ruby version
Bellow code lines is use install ruby 1.9.3 on Centos. You can refference it.
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 1.9.3
rvm use 1.9.3 --default
this will be a multi-step process and largely depends on the gems you're using. it really helps if you happen to have test coverage, otherwise it might get a little painful.
here's shortly what I would do (did some 2.3 upgrades previously) :
upgrade JRuby to latest 1.7.x it defaults to 1.9.3 but using --1.8 makes it 1.8.7 compatible
setup Bundler on Rails 2.3 http://bundler.io/v1.11/rails23.html (will help managing the gems)
attempt to upgrade to Rails 3.2 (review an empty created app to adjust the environment/*.rb, environment.rb, boot.rb etc. accordingly) - some gems might need an upgrade or replacing
switch off the --1.8 switch for JRuby ... you'll be running with 1.9.3
(optional) upgrade to Rails 4.x
(optional) upgrade to JRuby 9.0.x
*each step assumes running tests or somehow testing out the app is in a working state.
I received a new Macbook Pro for work and started to setup my local machine for development. I installed RVM, then proceeded to install different ruby versions: 2.1, 2.0, 1.9, and 1.8.7. I need 1.8.7 because I will be working on an older site running this legacy version of ruby.
Anyway, when I type: rvm install 1.8.7, rvm installs both 1.8.7-p374 and 1.8.7-head. These installs were successful. When I type: rvm use 1.8.7, it defaults to the ruby-1.8.7-head version.
Why does rvm insist on installing both versions of ruby 1.8.7?
Please specify explicit full version of ruby to install:
rvm install 1.8.7-p374
In case of version ruby-2.0, you get the only version because there is the only one for the specified.
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)
It seems that most of Rails 3, Ruby 1.9.2 can be used, but when it is sqlite3-ruby, or mysql2 gems, then it can't compile, (missing mkmf?) and the latest Xcode is needed. But the latest Xcode is for Snow Leopard only. So looks like the Macbook needs to be upgraded to Snow Leopard before Rails 3 can be used?
Have you tried using RVM? It provides an easy way to install different Ruby (and Rails) versions in your system. This guy here describes his experience with RVM, mysql and MacOS 10.5.
Hope it helps!
It should work on Leopard without the new Xcode, get it with sudo gem install rails.