bonsai
bonsai

Reputation: 141

How can I work with a different rails version?

I have the "Agile Web Development with Rails fourth edition" and I have installed the 3.0.5 version of rails, but I'm using the 2.3.5 version, and much things in the book I tried I got fail, and I think is for the version. Am I in the true? How can I change my version?

thanks a lot!

Upvotes: 0

Views: 109

Answers (4)

Sam Ruby
Sam Ruby

Reputation: 4340

The very first page of the book starts out with "this book is for Rails 3". There are many, many changes in Rails 3, so this book simply won't work with Rails 2. The previous edition is definitely what you want if you absolutely must use Rails 2.3.5.

Section 1.4 in Edition 4 is devoted to choosing a Rails version. In edition 3, this was covered in section 3.5.

Disclosure: I am one of the authors of this book.

Upvotes: 1

inntran
inntran

Reputation: 1033

Yes, the Rails version matters.

If you want to stick to Rails 2, you might need the 3rd edition of that book.

If the Ruby version you are using is 1.8.7 or 1.9.2, you can install Rails 3.

Are you using the Ruby environment bundled with the system? Or instant rails on Windows?

On Linux systems, you can install Ruby with the help of rvm, then install Rails using "gem install rails"

On Windows, you'd better get the latest version of Ruby from ruby-lang.org, then install Rails gem. That would be a lot of hard work.

Upvotes: 0

Rene van Lieshout
Rene van Lieshout

Reputation: 372

Rails 3 uses Bundler (http://gembundler.com) by default. Use

bundle exec <command>

to run your commands using the correct version of rails.

examples:

bundle exec rake db:migrate
bundle exec rails server

Upvotes: 0

amaseuk
amaseuk

Reputation: 2155

You may need to update Ruby so have a look at RVM : http://beginrescueend.com/

Did you run bundle install to install the Rails version in the Gemfile?

Upvotes: 0

Related Questions