How to create project with prior version of Rails

3 views
Skip to first unread message

Ruby Freak

unread,
Jan 8, 2008, 12:23:40 AM1/8/08
to Ruby on Rails: Talk
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

Ryan Bigg

unread,
Jan 8, 2008, 12:47:31 AM1/8/08
to rubyonra...@googlegroups.com
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.

Josh Susser

unread,
Jan 8, 2008, 1:28:01 AM1/8/08
to rubyonra...@googlegroups.com
Ryan Bigg 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 Susser
http://blog.hasmanythrough.com

--
Posted via http://www.ruby-forum.com/.

Frederick Cheung

unread,
Jan 8, 2008, 3:20:40 AM1/8/08
to rubyonra...@googlegroups.com

On 8 Jan 2008, at 06:28, Josh Susser wrote:

>
> Ryan Bigg 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

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

Frederick Lee

unread,
Feb 14, 2008, 2:43:15 PM2/14/08
to rubyonra...@googlegroups.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 http://gems.rubyforge.org/Marshal.4.8

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 Bigg
> http://www.frozenplague.net
> Feel free to add me to MSN and/or GTalk as this email.

Frederick Lee

unread,
Feb 14, 2008, 3:08:04 PM2/14/08
to rubyonra...@googlegroups.com
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:
- http://gems.rubyforge.org

[/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.


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

Rick DeNatale

unread,
Feb 14, 2008, 6:22:55 PM2/14/08
to rubyonra...@googlegroups.com

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/

Reply all
Reply to author
Forward
0 new messages