这个应用程序,“ecozap:http://www.ecozap.es/”是由另一位开发人员在五年前开发的,它已被重新发布,我必须进行设计更改和CSS样式...
该应用程序在heroku版本v174上运行。
是否有必要迁移数据库以进行更新并在heroku上推送应用程序?
我只更改了样式并添加了图片。
这是我的database.yml文件:
# SQLite version 3.x
# gem install sqlite3
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
staging:
adapter: sqlite3
database: db/staging.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
这是我的Gemfile:
source 'http://rubygems.org'
ruby '1.9.3'
gem 'rails', "= 3.1.11"
#gem "rake", "= 0.8.7"
gem 'racc'
# gem 'sqlite3'
#gem 'acts_as_list', '>= 0.1.0'
#gem 'acts_as_tree'
gem 'paperclip'
gem 'aws-s3', :require => 'aws/s3'
gem 'aws-sdk'
gem 'gravatar_image_tag'
gem 'kaminari'
gem 'jquery-rails', '~> 2.1'
gem 'RedCloth', '>= 3.301'
gem 'carmen', :git => 'git://github.com/alvatarc/carmen.git', :branch => '0.2.x'
#gem 'carmen'
gem 'sass-rails'
gem 'http_accept_language'
gem 'right_aws'
gem 'exception_notification'#, '3.0.1'#añadido
group :development do
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'rspec-rails', '= 2.7.0'
gem 'rspec-core', '= 2.7.1'
gem 'rspec'
#gem 'annotate-models'
gem 'faker'
gem 'therubyracer', :platform => 'ruby'
end
group :test do
gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'rspec-rails', '= 2.7.0'
gem 'rspec-core', '= 2.7.1'
gem 'rspec'
gem 'webrat'
gem 'spork', '= 0.9.0.rc9'
gem 'factory_girl_rails'
end
group :production do
gem 'pg'
gem 'uglifier'
end
当我推送到heroku时,我收到以下错误:
C:\Sites\ecozap>heroku logs --app ecozap
2014-01-28T09:31:23.706553+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `each'
2014-01-28T09:31:23.706553+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `inject'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:30:in `instance_exec'
2014-01-28T09:31:23.706553+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.11/lib/ac
tion_dispatch/middleware/stack.rb:43:in `build': undefined method `new' for ExceptionNotifier:Module (No
MethodError)
2014-01-28T09:31:23.706648+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `build'
2014-01-28T09:31:23.706648+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/engine.rb:447:in `app'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/application.rb:96:in `initialize!'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:30:in `run'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:54:in `run_initializers'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/railtie/configurable.rb:30:in `method_missing'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:55:in `block in run_initializers'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/config.ru:8:in `block in <main>'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:51:in `instance_eval'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:51:in `initialize'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/config.ru:8:in `require'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/config.ru:in `new'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/server.rb:304:in `wrapped_app'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:40:in `eval'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/server.rb:200:in `app'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:40:in `parse_file'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands/server.rb:46:in `app'
2014-01-28T09:31:23.706774+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:54:in `each'
2014-01-28T09:31:23.706975+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/server.rb:254:in `start'
2014-01-28T09:31:23.707423+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands/server.rb:70:in `start'
2014-01-28T09:31:23.707423+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands.rb:54:in `block in <top (required)>'
2014-01-28T09:31:23.707423+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands.rb:49:in `tap'
2014-01-28T09:31:23.707423+00:00 app[web.1]: from script/rails:6:in `require'
2014-01-28T09:31:23.707423+00:00 app[web.1]: from script/rails:6:in `<main>'
2014-01-28T09:31:23.707423+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands.rb:49:in `<top (required)>'
2014-01-28T09:31:25.113332+00:00 heroku[web.1]: Error R12 (Exit timeout) -> At least one process failed
to exit within 10 seconds of SIGTERM
2014-01-28T09:31:25.113517+00:00 heroku[web.1]: Stopping remaining processes with SIGKILL
2014-01-28T09:31:25.239226+00:00 heroku[web.1]: Process exited with status 1
2014-01-28T09:31:25.254967+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-28T09:31:25.256579+00:00 heroku[web.1]: State changed from crashed to starting
2014-01-28T09:31:26.892077+00:00 heroku[web.1]: Process exited with status 137
2014-01-28T09:31:29.944119+00:00 heroku[web.1]: Starting process with command `bundle exec rails server
-p 15889`
2014-01-28T09:31:33.583232+00:00 app[web.1]: Your Gemfile lists the gem sqlite3-ruby (>= 0) more than on
ce.
2014-01-28T09:31:33.583232+00:00 app[web.1]: You should probably keep only one of them.
2014-01-28T09:31:33.583232+00:00 app[web.1]: You should probably keep only one of them.
2014-01-28T09:31:33.583232+00:00 app[web.1]: While it's not a problem now, it could cause errors if you
change the version of just one of them later.
2014-01-28T09:31:33.583232+00:00 app[web.1]: While it's not a problem now, it could cause errors if you
change the version of just one of them later.
2014-01-28T09:31:33.583232+00:00 app[web.1]: Your Gemfile lists the gem rspec-rails (= 2.7.0) more than
once.
2014-01-28T09:31:33.583232+00:00 app[web.1]: Your Gemfile lists the gem rspec (>= 0) more than once.
2014-01-28T09:31:33.583428+00:00 app[web.1]: You should probably keep only one of them.
2014-01-28T09:31:33.583232+00:00 app[web.1]: You should probably keep only one of them.
2014-01-28T09:31:33.583232+00:00 app[web.1]: While it's not a problem now, it could cause errors if you
change the version of just one of them later.
2014-01-28T09:31:33.583232+00:00 app[web.1]: Your Gemfile lists the gem rspec-core (= 2.7.1) more than o
nce.
2014-01-28T09:31:33.583428+00:00 app[web.1]: While it's not a problem now, it could cause errors if you
change the version of just one of them later.
2014-01-28T09:31:44.462215+00:00 app[web.1]: => Booting WEBrick
2014-01-28T09:31:44.462215+00:00 app[web.1]: => Call with -d to detach
2014-01-28T09:31:44.462215+00:00 app[web.1]: => Rails 3.1.11 application starting in production on http:
//0.0.0.0:15889
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `inject'
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `build'
2014-01-28T09:31:44.462215+00:00 app[web.1]: Exiting
2014-01-28T09:31:44.463228+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.11/lib/ac
tion_dispatch/middleware/stack.rb:43:in `build': undefined method `new' for ExceptionNotifier:Module (No
MethodError)
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `block in build'
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.1.1
1/lib/action_dispatch/middleware/stack.rb:112:in `each'
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/engine.rb:447:in `app'
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/application/finisher.rb:37:in `block in <module:Finisher>'
2014-01-28T09:31:44.462215+00:00 app[web.1]: => Ctrl-C to shutdown server
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:30:in `instance_exec'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:54:in `run_initializers'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/config/environment.rb:5:in `<top (required)>'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/config.ru:8:in `block in <main>'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/config.ru:8:in `require'
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:55:in `block in run_initializers'
2014-01-28T09:31:44.463228+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:30:in `run'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/initializable.rb:54:in `each'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/server.rb:200:in `app'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands/server.rb:46:in `app'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:51:in `instance_eval'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/config.ru:in `new'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:51:in `initialize'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/railtie/configurable.rb:30:in `method_missing'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/config.ru:in `<main>'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:40:in `eval'
2014-01-28T09:31:44.463441+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/application.rb:96:in `initialize!'
2014-01-28T09:31:44.464071+00:00 app[web.1]: from script/rails:6:in `require'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands.rb:54:in `block in <top (required)>'
2014-01-28T09:31:44.464071+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands.rb:49:in `<top (required)>'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands.rb:49:in `tap'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/server.rb:304:in `wrapped_app'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.1.11/
lib/rails/commands/server.rb:70:in `start'
2014-01-28T09:31:44.464071+00:00 app[web.1]: from script/rails:6:in `<main>'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/server.rb:254:in `start'
2014-01-28T09:31:44.463612+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.3.10/lib/
rack/builder.rb:40:in `parse_file'
2014-01-28T09:31:46.058892+00:00 heroku[web.1]: Process exited with status 1
2014-01-28T09:31:46.069301+00:00 heroku[web.1]: State changed from starting to crashed
2014-01-28T09:31:47.241185+00:00 heroku[nginx]: 87.218.164.248 - - [28/Jan/2014:09:31:47 +0000] "GET /?l
ocale=es HTTP/1.1" 503 409 "http://www.ecozap.es/?locale=es" "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/5
37.36 (KHTML, like Gecko) Chrome/32.0.1700.76 Safari/537.36" www.ecozap.es
2014-01-28T09:31:47.240108+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/?
locale=es host=www.ecozap.es request_id=cf3976b7-4c4b-4d11-b3dd-036cfc5c1ddb fwd="87.218.164.248" dyno=
connect= service= status=503 bytes=
2014-01-28T09:31:50.354991+00:00 heroku[nginx]: 5.10.83.26 - - [28/Jan/2014:09:31:50 +0000] "GET /carts/
918632?locale=es HTTP/1.1" 503 409 "-" "Mozilla/5.0 (compatible; AhrefsBot/5.0; +http://ahrefs.com/robot
/)" www.ecozap.es
2014-01-28T09:31:50.335416+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/c
arts/918632?locale=es host=www.ecozap.es request_id=7f03696d-14bb-422c-befa-48cf359ab21f fwd="5.10.83.26
" dyno= connect= service= status=503 bytes=
2014-01-28T09:30:08.610174+00:00 heroku[router]: at=info method=GET path=/?locale=es host=www.ecozap.es
request_id=7e7f92e3-94ad-47a0-9154-90655af1633c fwd="87.218.164.248" dyno=web.1 connect=1ms service=125m
s status=304 bytes=0
2014-01-28T09:30:09.487341+00:00 heroku[router]: at=info method=GET path=/assets/bg-e370e1a45db2fb66fee9
eb2ac688e649.png host=www.ecozap.es request_id=15ef80ef-0429-4f81-bf21-dca347746082 fwd="87.218.164.248"
dyno=web.1 connect=4ms service=7ms status=304 bytes=0
2014-01-28T09:30:09.167444+00:00 heroku[router]: at=info method=GET path=/assets/CO2-plus-abfd84d445691d
3ace3d797cee661210.jpg host=www.ecozap.es request_id=bd87c4ae-90f3-4c27-a245-c79a836ea13e fwd="87.218.16
4.248" dyno=web.1 connect=1ms service=6ms status=304 bytes=0
2014-01-28T09:30:09.521797+00:00 heroku[router]: at=info method=GET path=/assets/eco-253306c2a7299a16c10
9b71d8374e37c.jpg host=www.ecozap.es request_id=f58b7f21-e986-4e56-a668-257df0fc39b1 fwd="87.218.164.248
" dyno=web.1 connect=2ms service=6ms status=304 bytes=0
2014-01-28T09:30:09.464954+00:00 heroku[router]: at=info method=GET path=/assets/eco-over-83ea6faa95bd9d
c45c1237aeb4624d00.jpg host=www.ecozap.es request_id=2979b3a4-e8d8-4cbc-94b1-253531753fa4 fwd="87.218.16
4.248" dyno=web.1 connect=1ms service=5ms status=304 bytes=0
2014-01-28T09:30:09.460994+00:00 heroku[router]: at=info method=GET path=/assets/women-over-44ae6e42fc1e
999038afe5485af27c60.jpg host=www.ecozap.es request_id=708ee385-433b-49e8-a3c1-e8342408fbe9 fwd="87.218.
164.248" dyno=web.1 connect=1ms service=5ms status=304 bytes=0
C:\Sites\ecozap>
答案 0 :(得分:1)
否没有必要迁移db for update并在heroku上推送应用程序。
迁移部分与部署不同,因此您可以轻松部署而无需迁移。
编辑: 假设您只想在本地测试生产环境
将database.yml更改为使用与开发相同的数据库。这样您就不需要更改gem文件了,可以使用开发环境测试生产环境
重要提示:在完成测试后回滚到原始database.yml
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
staging:
adapter: sqlite3
database: db/staging.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/development.sqlite3 #<==This is the change
pool: 5
timeout: 5000