开发者

How can I work with a different rails version?

开发者 https://www.devze.com 2023-03-29 12:59 出处:网络
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开发者_Go百科 I tried I got

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开发者_Go百科 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!


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.


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?


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消