开发者

after upgrading to rails 3, 'rails server' still just shows usage

I've recently updated a rails 2.3.10 application to rails 3.0.5. I followed the rails-upgrade gem instructions. Running bundle install works fine. I've update the boot.rb application.rb and environment.rb.

$ bundle install
Using rake (0.8.7) 
...
Using railties (3.0.5) 
Using rails (3.0.5) 
...

However, when I call 'rails server' I still get usage instructions:

$ rails server
Usage:
  rails new APP_PATH [options]

Anyone have any ideas why this is happening? I suspe开发者_StackOverflow社区ct an error is getting swallowed somewhere from the upgrade procedure, but I'm not sure where to look.


I just figured out a way to fix this, so I thought I'd add the step for everyone else to follow.

After doing the rails-upgrade steps:

rake rails:upgrade:check
rake rails:upgrade:backup

build a new rails app over the existing one, by doing the following WITHIN the app's directory.

rails_2_app $ rails new .

And then continue the upgrade as normal.


You need to delete all the existing files under script folder and to create a file called rails under the same folder. The rails file should contain the following:

APP_PATH = File.expand_path('../../config/application',  __FILE__)
require File.expand_path('../../config/boot',  __FILE__)
require 'rails/commands'

that's all you are good to do. You will have all the commands.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜