# How to make a 126 rails project when 2.02 is installed with windows

**URL:** <https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125>\
**Category:** Rails\
**Created:** [April 18, 2008, 7:18am UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125 "2008-04-18T07:18:26Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 18, 2008, 7:18am UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/1 "2008-04-18T07:18:26Z")

</div>

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

I posted this question and got this answer:

You can generate a NEW rails 1.2.6 project like this  
$rails _1.2.6_ myproject

That will probably work on a linix machine, but I couldn’t get it go  
on XP, at least not for 1.2.3

I finally got it to work. I needed a rails 1.2.3 app so I did this:

gem install rails -v=1.2.3  
which on my machine, installed in rails 1.2.3 in  
C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3

cd to C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3  
then  
rails C:\rails\_projects\_dir\my\_app\_name

Which created the rails app my\_app\_name in the directory named C:  
\rails\_projects\_dir

Good luck

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 18, 2008, 11:46am UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/2 "2008-04-18T11:46:18Z")

</div>

No, that did’nt work.  
I got a 2.02 project

crap

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 18, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/3 "2008-04-18T14:33:56Z")

</div>

OK, I got it

just CD to the dir in which you want the project, like normal and run:

ruby C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3\bin\rails my\_project

Then  
rake rails:freeze:edge TAG=rel\_1-2-3

viola

If I run Rails -v I get 2.0.2 but when I run ruby script/server the  
page says 123

fun stuff

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 18, 2008, 2:58pm UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/4 "2008-04-18T14:58:04Z")

</div>

Actually it’s way simpler than that.

Make sure you have the latest rubygems and that you have rails 1.2.6  
gems  
installed  
gem update --system  
gem install rails -v=1.2.6

Then create a new project with Rails 1.2.6

rails _1.2.6_ my\_project

Then freeze if desired.

The _x.y.z_ parameter tells Rubygems which version should be used.

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 18, 2008, 11:30pm UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/5 "2008-04-18T23:30:23Z")

</div>

Thanks but…

Not trying to be a jerk however I tried that about 40 times over two  
hours with every variation imaginable.  
rails\_1.2.3\_ my\_project  
rails\_1-2-3\_ my\_project  
rails\_123\_ my\_project  
rails\_1.2.3 my\_project  
rails TAG=rel\_1-2-3 my\_project (made a project named “TAG=rel\_1-2-3”)

If you can think of it, I tried it

The point of my post was that what you describe doesn’t work. At least  
not for me, on Windows XP with version 1.2.3

On Apr 17, 9:26 pm, “Brian H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ruby C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3\bin\rails my\_project
> 
> > > > I posted this question and got this answer:  
> > > > which on my machine, installed in rails 1.2.3 in  
> > > > C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3
> 
> > > > cd to C:\ruby\lib\ruby\gems\1.8\gems\rails-1.2.3  
> > > > then  
> > > > rails C:\rails\_projects\_dir\my\_app\_name
> 
> > > > Which created the rails app my\_app\_name in the directory named C:  
> > > > \rails\_projects\_dir
> 
> >

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 19, 2008, 3:48am UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/6 "2008-04-19T03:48:57Z")

</div>

@Rails Freak: I tried it with six versions of the framework installed  
(2.0.2, 2.0.1, 1.2.6, 1.2.5, 1.2.4, 1.2.2), Ruby 1.8.6, Windows XP.  
It worked the first time and every time.

railsversionapp\_name

rails _1.2.2_ test  
…

test/config/environment.rb

# Be sure to restart your web server when you modify this file.

# Uncomment below to force Rails into production mode when

# you don’t control web/app server and can’t set it the proper way

# ENV[‘RAILS\_ENV’] ||= ‘production’

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

present  
RAILS\_GEM\_VERSION = ‘1.2.2’ unless defined? RAILS\_GEM\_VERSION  
…

(Note the GEM\_VERSION ^^^ )

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 19, 2008, 4:45am UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/7 "2008-04-19T04:45:46Z")

</div>

AndyV  
Sure as hell, It worked as you say  
I was missing the space between rails and _1.2.3._

My face is red now

---

<div class="post-metadata">

**Author:** ![rubyfreak](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e9c0ed/32.png) [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Post date:** [April 19, 2008, 3:56am UTC](https://www.ruby-forum.com/t/how-to-make-a-126-rails-project-when-2-02-is-installed-with-windows/135125/8 "2008-04-19T03:56:34Z")

</div>

Just in case this helps, here’s the contents of your c:\ruby\bin  
\rails:

* * *

#!C:/ruby/bin/ruby

# 

# This file was generated by RubyGems.

# 

# The application ‘rails’ is installed as part of a gem, and

# this file is here to facilitate running it.

# 

## require ‘rubygems’ version = “\> 0” if ARGV.first =~ /^_(.\*)_$/ and Gem::Version.correct? $1 then version = $1 ARGV.shift end gem ‘rails’, version load ‘rails’

Check out the line below: version = “\> 0”  
They’re parsing the first argument and looking for a string beginning  
and ending with underscores. If it exists then it’s checked to see if  
it’s a valid Gem version. If that’s true (ie., you have that version  
of the gem installed) then a rails app of that version is created.
