How to create project with prior version of Rails

Hi and Thanks in advance

I have 2.02 installed on my machine but I need to create a 1.25
project. If I create the project, it is a 2.02 app and when I do:
svn export http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-5 vendor/
rails

it trys to run the newly created 2.0.2 app in 125 and I get

undefined method `last’ for {}:Hash
C:/rails_projects/new_app/rakefile:10

How do I make a 125 rails project when 2.02 is installed?

Again, Thanks for you help

twscannell at gmail

You can do:

gem install rails -v=1.2.5
rails -d mysql

and then manually change the RAILS_GEM_VERSION in config/environment.rb.

On Jan 8, 2008 3:53 PM, Ruby F. [email protected] wrote:

undefined method `last’ for {}:Hash
C:/rails_projects/new_app/rakefile:10

How do I make a 125 rails project when 2.02 is installed?

Again, Thanks for you help

twscannell at gmail


Ryan B.

Feel free to add me to MSN and/or GTalk as this email.

Ryan B. wrote:

You can do:

gem install rails -v=1.2.5
rails -d mysql

and then manually change the RAILS_GEM_VERSION in config/environment.rb.

Hmm. You shouldn’t build the 1.2.5 project with the 2.0.2 rails
command. After installing the 1.2.5 gem, you can execute the rails
command in that gem directly:

$ ruby /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/bin/rails
my_app_name

If you installed ruby gems someplace different, just fix the path to
point to the right place.


Josh S.
http://blog.hasmanythrough.com

On 8 Jan 2008, at 06:28, Josh S. wrote:

Hmm. You shouldn’t build the 1.2.5 project with the 2.0.2 rails
command. After installing the 1.2.5 gem, you can execute the rails
command in that gem directly:

$ ruby /usr/local/lib/ruby/gems/1.8/gems/rails-1.2.5/bin/rails
my_app_name

or rails 1.2.5 myapp
Executables created with gem are smart enough to see the version
argument and work out that they should be loading that version

Fred

This is what I’ve managed to do so far:

[/Users/Ric/workarea/ruby]sudo gem install rails -v=“1.2.6”
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Successfully installed rails-1.2.6
1 gem installed

[/Users/Ric/workarea/ruby]gem list | grep ‘rails’
rails (2.0.2, 1.2.6, 1.2.5)

[/Users/Ric/workarea/ruby]gem environment
RubyGems Environment:

  • RUBYGEMS VERSION: 1.0.1 (1.0.1)
  • RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]
  • INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
  • RUBY EXECUTABLE: /opt/local/bin/ruby
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-darwin-8
  • GEM PATHS:
    • /opt/local/lib/ruby/gems/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

[/Users/Ric/workarea/ruby]rails --version
Rails 2.0.2


I’m a little lost here.
What I want to do is, to toggle from Rails 2.0.2 to 1.2.6 so I can
follow the codes in the AWDR book (based on 1.2.5). I had updated rails
to 1.2.6. ← I don’t think I need to do this, since I have the
following:

rails (2.0.2, 1.2.6, 1.2.5)

So…

I’m assuming that all I need to do is to modify the following in
config/environment.rb:

Specifies gem version of Rails to use when vendor/rails is not present

RAILS_GEM_VERSION = ‘2.0.2’ unless defined? RAILS_GEM_VERSION

to -->RAILS_GEM_VERSION = ‘1.2.6’.

Then I should be able to code per AWDR book?

Sigh…
…I’ll give it a go.

Ric.

===============

Frederick L. wrote:

I’m trying to do the same.
I’ve the latest Ruby/Rails config.

But now I want to switch to Rails v. 1.2.6 to follow the book: ‘Agile
Web Dev with Rails’.
So I did the following:

[/Users/Ric/workarea/ruby]gem install rails -v=1.2.6
ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
getaddrinfo: nodename nor servname provided, or not known
(SocketError)
getting size of RubyGems.org | your community gem host

What’s going on here?

Is it possible to toggle Rails versions like 1.2.6 <—> 2.0.2?

What am I missing?

Env: Mac OS X (Leopard).

Ric.

Ryan B. wrote:

You can do:

gem install rails -v=1.2.5
rails -d mysql

and then manually change the RAILS_GEM_VERSION in config/environment.rb.

On Jan 8, 2008 3:53 PM, Ruby F. [email protected] wrote:

undefined method `last’ for {}:Hash
C:/rails_projects/new_app/rakefile:10

How do I make a 125 rails project when 2.02 is installed?

Again, Thanks for you help

twscannell at gmail


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.

On Thu, Feb 14, 2008 at 3:08 PM, Frederick L.
[email protected] wrote:

rails (2.0.2, 1.2.6, 1.2.5)

  • GEM PATHS:
    [/Users/Ric/workarea/ruby]rails --version
    rails (2.0.2, 1.2.6, 1.2.5)

Then I should be able to code per AWDR book?

No, I don’t think so because the rails app you generated has the
structure of a 2.0 app.

But you can generate a NEW rails 1.2.6 project like this

$rails 1.2.6 myproject


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

I’m trying to do the same.
I’ve the latest Ruby/Rails config.

But now I want to switch to Rails v. 1.2.6 to follow the book: ‘Agile
Web Dev with Rails’.
So I did the following:

[/Users/Ric/workarea/ruby]gem install rails -v=1.2.6
ERROR: While executing gem … (Gem::RemoteFetcher::FetchError)
getaddrinfo: nodename nor servname provided, or not known
(SocketError)
getting size of RubyGems.org | your community gem host

What’s going on here?

Is it possible to toggle Rails versions like 1.2.6 <—> 2.0.2?

What am I missing?

Env: Mac OS X (Leopard).

Ric.

Ryan B. wrote:

You can do:

gem install rails -v=1.2.5
rails -d mysql

and then manually change the RAILS_GEM_VERSION in config/environment.rb.

On Jan 8, 2008 3:53 PM, Ruby F. [email protected] wrote:

undefined method `last’ for {}:Hash
C:/rails_projects/new_app/rakefile:10

How do I make a 125 rails project when 2.02 is installed?

Again, Thanks for you help

twscannell at gmail


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.