I'm trying to upgrade from Rails 2.3.15 to 3.2.17
我正在尝试从Rails 2.3.15升级到3.2.17
I did bundle update
, and changed controller syntax as needed.
我做了捆绑更新,并根据需要更改了控制器语法。
Trying to start the server and I'm getting the following error, is anyone familiar with this?
尝试启动服务器并且我收到以下错误,有人熟悉这个吗?
>> bundle exec script/server
/opt/boxen/rbenv/versions/1.9.3-p545/lib/ruby/gems/1.9.1/gems/bundler-1.7.0/lib/bundler/rubygems_integration.rb:266:in `block in replace_gem': can't activate rails (= 2.3.15), already activated rails-3.2.17. Make sure all dependencies are added to Gemfile. (Gem::LoadError)
from /Users/neo/src/myapp/config/boot.rb:60:in `load_rails_gem'
from /Users/neo/src/myapp/config/boot.rb:54:in `load_initializer'
from /Users/neo/src/myapp/config/boot.rb:38:in `run'
from /Users/neo/src/myapp/boot.rb:11:in `boot!'
from /Users/neo/src/myapp/config/boot.rb:114:in `<top (required)>'
from script/server:2:in `require'
from script/server:2:in `<main>'
My Gemfile:
我的Gemfile:
source "https://rubygems.org"
#ruby "1.8.7", :group => :staging
gem 'rails', '3.2.17'
gem 'rake', '0.9.2'
gem "aws-s3", :require => "aws/s3"
gem 'authlogic', '~> 2.1.1'
gem 'RedCloth', :require => "redcloth"
gem 'logging'
gem 'panda'
gem 'hoptoad_notifier'
gem 'fastercsv'
gem "comma", "~> 2.0" # specifying -v to add support to rails 2
gem 'pg'
gem 'cloudfront-signer'
gem 'newrelic_rpm'
gem 'thin'
group :development do
gem 'heroku'
gem 'taps'
gem 'sqlite3'
gem 'pry'
gem 'rdoc'
end
gem 'heroku_san'
group :test do
gem 'pg'
end
Any help would be greatly appreciated! thank you
任何帮助将不胜感激!谢谢
EDIT:
编辑:
With rails s
or bundle exec rails s / server
, I just get the about rails message, like below:
使用rails s或bundle exec rails s / server,我只需获取about rails消息,如下所示:
rails new APP_PATH [options]
Options:
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /opt/boxen/rbenv/versions/1.9.3-p545/bin/ruby
-b, [--builder=BUILDER] # Path to a application builder (can be a filesystem path or URL)
-m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL)
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile
[--skip-bundle], [--no-skip-bundle] # Don't run bundle install
-G, [--skip-git], [--no-skip-git] # Skip Git ignores and keeps
-O, [--skip-active-record], [--no-skip-active-record] # Skip Active Record files
-S, [--skip-sprockets], [--no-skip-sprockets] # Skip Sprockets files
-d, [--database=DATABASE] # Preconfigure for selected database .
.
.
2 个解决方案
#1
2
You should be using
你应该使用
bundle exec rails server
EDIT: Everything that used to be in the script directory is now managed by the rails command. When upgrading, I found it much easier to use a gemset to isolate the new gems from the old as it was often necessary to switch back and forth, and the new rails command will not play nicely with the old.
编辑:以前在脚本目录中的所有内容现在都由rails命令管理。在升级时,我发现使用gemset将新宝石与旧宝石隔离起来要容易得多,因为往往需要来回切换,而新的rails命令将无法与旧版本完美配合。
#2
1
Rails 3 using new command syntax for start server, console, scaffold etc.
Rails 3使用新的命令语法来启动服务器,控制台,脚手架等。
In rails 3 script/* got replaced by script/rails
在rails 3中脚本/ *被脚本/ rails替换
So, you need to start your server like:
所以,你需要启动你的服务器,如:
rails s
OR
要么
rails server
#1
2
You should be using
你应该使用
bundle exec rails server
EDIT: Everything that used to be in the script directory is now managed by the rails command. When upgrading, I found it much easier to use a gemset to isolate the new gems from the old as it was often necessary to switch back and forth, and the new rails command will not play nicely with the old.
编辑:以前在脚本目录中的所有内容现在都由rails命令管理。在升级时,我发现使用gemset将新宝石与旧宝石隔离起来要容易得多,因为往往需要来回切换,而新的rails命令将无法与旧版本完美配合。
#2
1
Rails 3 using new command syntax for start server, console, scaffold etc.
Rails 3使用新的命令语法来启动服务器,控制台,脚手架等。
In rails 3 script/* got replaced by script/rails
在rails 3中脚本/ *被脚本/ rails替换
So, you need to start your server like:
所以,你需要启动你的服务器,如:
rails s
OR
要么
rails server