How to Downgrade from Ruby 1.9.2 to Ruby 1.8.7 to Run Rails 2.0.2

How to Downgrade from Ruby 1.9.2 to Ruby 1.8.7 to run Rails 2.0.2

Whole point of RVM is so that you can have multiple versions of Ruby and switch among them easily..

rvm install 1.8.7 #or some specific version - choose from the rvm list known
rvm use 1.8.7
rvm gemset create rails202 #create a gemset called "rails202" for Ruby 1.8.7
rvm 1.8.7@rails202 #make the gemset the current selection
gem install rails -v 2.0.2 #install rails (just for this gemset!)
#now, we have a gemset called "rails202" in Ruby 1.8.7.
#anytime we want to use it, we do:
rvm 1.8.7@rails202
#create as many gemsets needed, eg for rails 3.0.3 on Ruby 1.8.7 we can do the
#similar as above. Then to use the new gemset just do:
rvm 1.8.7@rails303
#et voila! we are now using Rails 3.0.3 on Ruby 1.8.7 !

upgrade from ruby 1.8.7 to 1.9.2

There is way too many subtle changes to cover in something like SO, but this covers it quite well (I'm not involved in any way):

http://www.rubyinside.com/19walkthrough/

Assuming you're using fairly standard Ruby there shouldn't be anything which will cause problems, but I'm sure your tests will point out anything that needs fixing.

how to convert Ruby application 1.8.7 to 1.9.2

Hope this tutorial is helpful to start working on upgrading your application to Ruby-1.9.3

He explained nicely how to upgrade from Ruby-1.8.7 to Ruby-1.9.3

Ruby 1.8.7 - upgrade to 1.9.2

You're stalling. You clearly know the answers to most of your questions, you're just shaky on whether or not you're right in your assumptions.

Yes 1.9.2 is faster. Yes you probably want to use RVM (though rbenv is gaining popularity too). You probably won't have many issues with your code updating to 1.9.2, but some libraries (e.g. rubydebug) are 1.8 specific.

I would recommend you don't stick with Site5. Either run your own (cloud?) server or (and I prefer this route) go with Heroku and focus on building your app, not managing a server.

Rails 3, ruby 1.8.7 with sqlite3-ruby 1.2.5, ruby 1.9.2 with sqlite3 1.3.8 easy switch Gemfile?

you can set platform for gems http://bundler.io/v1.3/man/gemfile.5.html

gem "sqlite3-ruby", :version => "1.2.5", :platforms => :mri_18
gem "sqlite3-ruby", :version => "1.3.8", :platforms => [:mri_19, :mri_20]

How to Upgrade Ruby 1.8.7 to 1.9.2 in Rubinius

Instead of deleting rubinius, I just write the command:

rvm ruby-1.9.3

then it works.

How do I switch back to ruby 1.8.7 from ruby 1.9.2?

Using:

sudo rvm --default use 1.8.7

changes it for root, not for you. Remember, RVM is primarily for creating a sandbox for you as a user, not for the system or another user. Since you've been using sudo, which is a bad thing, you probably have things that are now owned by root, not you, which will cause your Ruby system to behave like it's psycho. Use chown to switch the ownership of all files in ~/.rvm back to you.

Use:

rvm system

to switch back to the default Ruby in /usr, /usr/local or /opt. Which one is called at that point will be determined by your PATH settings.

To switch between versions in your account that display when you do rvm list, use:

rvm use 1.8.7

or simply

rvm 1.8.7

If you want to make that the default version that is sticky, add on --default to the end of the command.

How do I switch back to ruby 1.8.7 from ruby 1.9.2?

Using:

sudo rvm --default use 1.8.7

changes it for root, not for you. Remember, RVM is primarily for creating a sandbox for you as a user, not for the system or another user. Since you've been using sudo, which is a bad thing, you probably have things that are now owned by root, not you, which will cause your Ruby system to behave like it's psycho. Use chown to switch the ownership of all files in ~/.rvm back to you.

Use:

rvm system

to switch back to the default Ruby in /usr, /usr/local or /opt. Which one is called at that point will be determined by your PATH settings.

To switch between versions in your account that display when you do rvm list, use:

rvm use 1.8.7

or simply

rvm 1.8.7

If you want to make that the default version that is sticky, add on --default to the end of the command.

Installing rails with ruby 1.9.2 after 1.8.7 was previously installed

You really should look into using rvm. http://beginrescueend.com/rvm/install/

It allows you to install rubies per project.

EDIT:

It looks like you may be using Windows. Give pik a try. https://github.com/vertiginous/pik/

Different Time Format in ruby 1.9.2 from ruby 1.8.7 causing issues

you can use

Time.now.asctime

in 1.9

EDIT 1:

well, depends on how you're going to use it. This should probably work for you:

irb(main):001:0> class Time
irb(main):002:1> class << self
irb(main):003:2> alias :orig_now :now
irb(main):004:2>
irb(main):005:2* def now
irb(main):006:3> orig_now.asctime
irb(main):007:3> end
irb(main):008:2> end
irb(main):009:1> end
=> nil
irb(main):010:0> Time.now
=> "Thu Jul 28 12:29:08 2011" # STRING
irb(main):011:0>

EDIT 2:

Ok, I got your question somewhat wrong. The above patch will cause Time.now to return the string (not the Time object).

If you just want to see Time object to be represented different you could apply this:

irb(main):011:0> class Time
irb(main):012:1>
irb(main):013:1* def inspect
irb(main):014:2> self.asctime
irb(main):015:2> end
irb(main):016:1> end
=> nil
irb(main):017:0> Time.now
=> Thu Jul 28 13:41:16 2011 # TIME


Related Topics



Leave a reply



Submit