I'm trying to deploy my first rails app on Heroku. I was using devise for authentication, but my needs changed, so I removed it and am now using sorcery.
Everything is working locally, but when deploying I get the following message when migrating my DB:
Running `rake db:migrate` attached to terminal... up, run.5220
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
uninitialized constant Devise
/app/config/initializers/devise.rb:3:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:588:in `block (2 levels) in <class:Engine>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:587:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/engine.rb:587:in `block in <class:Engine>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `instance_exec'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:30:in `run'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:55:in `block in run_initializers'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `each'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/initializable.rb:54:in `run_initializers'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:136:in `initialize!'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/railtie/configurable.rb:30:in `method_missing'
/app/config/environment.rb:5:in `<top (required)>'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:103:in `require_environment!'
/app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.8/lib/rails/application.rb:295:in `block (2 levels) in initialize_tasks'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
I can't seem to find any remaining mentions of Devise. Has anybody else run into a problem like this after removing the gem?
Thanks!
You also need to remove the Devise initializer file /app/config/initializers/devise.rb.
Related
Heroku is rejecting the push with the following message:
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
Running: rake assets:precompile
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out
and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on
this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_c758e521-24e9-4477-b6d7-73
cc961fb8d2/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out
and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on
this: (called from <top (required)> at /tmp/build_c758e521-24e9-4477-b6d7-73
cc961fb8d2/Rakefile:7)
rake aborted!
could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `initialize'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `new'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:1222:in `connect'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:324:in `initialize'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:28:in `new'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/postgre
sql_adapter.rb:28:in `postgresql_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:315:in `new_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:325:in `checkout_new_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:247:in `block (2 levels) in checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:242:in `loop'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:242:in `block in checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:239:in `checkout'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:102:in `block in connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:101:in `connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_pool.rb:410:in `retrieve_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:171:in `retrieve_connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/connection_adapters/abstrac
t/connection_specification.rb:145:in `connection'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/model_schema.rb:310:in `cle
ar_cache!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.14/lib/active_record/railtie.rb:103:in `block (2
levels) in <class:Railtie>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:418:in `_run
__1575907776091260551__prepare__1163126976531258673__callbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:405:in `__ru
n_callback'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:385:in `_run
_prepare_callbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/callbacks.rb:81:in `run_c
allbacks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:74:i
n `prepare!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/action_dispatch/middleware/reloader.rb:48:i
n `prepare!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application/finisher.rb:47:in `block in
<module:Finisher>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `instance_exec'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:30:in `run'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:55:in `block in run_in
itializers'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `each'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/initializable.rb:54:in `run_initializer
s'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:136:in `initialize!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/railtie/configurable.rb:30:in `method_m
issing'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/config/environment.rb:5:in `<top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `r
equire'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `b
lock in require'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:236:in `l
oad_dependency'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.14/lib/active_support/dependencies.rb:251:in `r
equire'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:103:in `require_environm
ent!'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/railties-3.2.14/lib/rails/application.rb:305:in `block (2 levels)
in initialize_tasks'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:93:in `block (2 level
s) in <top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:60:in `block (3 level
s) in <top (required)>'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:23:in `invoke_or_rebo
ot_rake_task'
/tmp/build_c758e521-24e9-4477-b6d7-73cc961fb8d2/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 level
s) in <top (required)>'
Tasks: TOP => environment
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
I've tried other's solutions in Stackoverflow without any success:
include gem rails_12factor
add the line " config.assets.initialize_on_precompile = false" in the application.rb
putting Sql3lite gem in the development/test group
and I've also tried some of my own including:
create a new stack cedar application
add a new SSH key
installed Heroku toolbelt.
commenting out PG gem in production
remove Gemfile.lock
My code is at https://github.com/charleshsu168/sample_app1
I am folloing Michael Hartl tutorial.
The DEPRECATION WARNING: 's are unrelated to your issue, I get them on my live servers.
It looks like Rails thinks that your DB server is available locally hence it is trying to connect to 127.0.0.1 which is localhost.
Based on the logs, looks like a DB configuration issue. Do you have postgres configured correctly. https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-ruby.
postgresql_adapter.rb:28:in `postgresql_connection'
I've got it to work somehow by trial and error. One of the thing I did is I deleted the old Heroku remote URL that doesn't exist anymore in .git/config, replace it with the new Heroku app name I've created, and then re-run: Heroku push master
Now it works!
I try to deploy my app to heroku but i'm getting this error:
Invalid CSS after " height: 4em;": expected "}", was "<<<<<<< HEAD"
Is the HEAD a problem in this situation?
I validated my custom.css file in w3 but nothing is changed.
Full trace of the error like that:
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/Rakefile:7)
rake aborted!
Invalid CSS after " height: 4em;": expected "}", was "<<<<<<< HEAD"
(in /tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/app/assets/stylesheets/custom.css.orig)
(sass):1166
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:1147:in `expected'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:1083:in `expected'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:1078:in `tok!'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:535:in `block'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:528:in `ruleset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:552:in `block_child'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:545:in `block_contents'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:82:in `stylesheet'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/scss/parser.rb:27:in `parse'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/engine.rb:342:in `_to_tree'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/engine.rb:315:in `_render'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-3.2.10/lib/sass/engine.rb:262:in `render'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sass-rails-3.2.6/lib/sass/rails/compressor.rb:12:in `compress'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/compressors.rb:74:in `compress'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processing.rb:243:in `block in css_compressor='
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:19:in `block in compile'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/static_compiler.rb:18:in `compile'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:56:in `internal_precompile'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
/tmp/build_cb755c6e-cfb5-4008-83be-23c2f4adbe3a/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
Tasks: TOP => assets:precompile:primary
(See full trace by running task with --trace)
!
! Precompiling assets failed.
!
! Push rejected, failed to compile Ruby app
You appear to have a git merge conflict in your css file. Resolve the conflict, commit the changes, and try pushing again. Update: Just noticed that it is a *.orig file. Git mergetool will save a backup of the the file with the markers (like <<<<<<< HEAD etc) and append the suffix '.orig'. You should delete these before committing or if you want to keep them around for other reasons you should add *.orig to your .gitignore. See here for more information on strategies for handling mergetool backups.
This is an error in parsing the CSS file called "custom.css.orig". The .orig suffix and the "<<<<<<< HEAD" part of the error message makes me think that you have committed a merge conflict diff file by mistake. You probably didn't mean to commit that file, and if you remove it you should no longer get this error.
I am a novice to Ruby on Rails and am following Michael Hartl's 3.2 tutorial book as a reference. I got my app running and deployed onto Heroku fine until I try to add the unofficial yummly gem.
http://rubygems.org/gems/yummly/versions/0.0.7
I get it to work locally (makes and fetches the api fine), but when I push it to Heroku, the app crashes and says it can't find Yummly.rb in the helper files on line 5.
Other than including
require Yummly
in my controller class and
gem "yummly"
(and running bundle install) in my Gemfile, what could I be missing? Perhaps I need to specify that the gem needs to be the latest version 0.0.9 (I couldn't get it to install so I didn't try to change it)?
Does this have to do with Heroku specifically? or does it have to do with the Yummly Gem specifically?
Heroku logs as follows
State changed from crashed to starting
Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 51790`
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5)
/app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:317:in `rescue in depend_on': Missing helper file helpers/Yummly.rb (LoadError)
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/helpers.rb:92:in `modules_for_helpers'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:131:in `modules_for_helpers'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:131:in `map!'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:135:in `block in modules_for_helpers'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:312:in `depend_on'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:225:in `require_dependency'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:159:in `default_helper_module!'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:135:in `inherited'
from /app/app/controllers/application_controller.rb:1:in `<top (required)>'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:95:in `helper'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
from /app/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:439:in `block (2 levels) in eager_load!'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/railties/routes_helpers.rb:7:in `block (2 levels) in with'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/action_controller/railties/paths.rb:7:in `block (2 levels) in with'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:22:in `block in inherited'
rom /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:22:in `class_eval'
from /app/vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.13/lib/abstract_controller/helpers.rb:22:in `inherited'
from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/engine.rb:436:in `ea
require takes a file or gem name to require so the classes and modules it defines are accessible in the current file.
Therefore, you should do the following :
require 'yummly'
Note the fact that it's a string and not a constant.
It is also completely downcased, as per convention, filenames in ruby never takes any uppercase.
However, since you're using bundler, you should know that is manages requiring your dependencies automatically. Therefore, you don't need to require your dependency at all.
I've got Rails2 application and I'm trying to upgrade it to Rails3 (plugin: https://github.com/rails/rails_upgrade).
Everything was fine till step of routes file upgrade. When I've tried to use rake rails:upgrade:routes following error displayed:
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config.
(in /home/chmarus/Pulpit/mmo)
WARNING: This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
DEPRECATION WARNING: config.action_controller.session= has been deprecated. Please use config.session_store(name, options) instead. (called from <class:Application> at /home/chmarus/Pulpit/mmo/config/application.rb:54)
DEPRECATION WARNING: Rake tasks in /home/chmarus/Pulpit/mmo/vendor/plugins/event_calendar/tasks/event_calendar_tasks.rake are deprecated. Use lib/tasks instead. (called from <top (required)> at /home/chmarus/Pulpit/mmo/Rakefile:7)
rake aborted!
undefined method `now' for nil:NilClass
(See full trace by running task with --trace)
Current Rails ver: 2.3.9
Destination ver: 3.0.3
What is worng? May I missed something? Maybe it's rake fault, but I'm not sure.
Edit: rake rails:upgrade:routes --trace
chmarus#Arti:~/Pulpit/mmo$ rake rails:upgrade:routes --trace
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake/alt_system.rb:32: Use RbConfig instead of obsolete and deprecated Config.
(in /home/chmarus/Pulpit/mmo)
WARNING: This version of mysql2 (0.3.11) doesn't ship with the ActiveRecord adapter bundled anymore as it's now part of Rails 3.1
WARNING: Please use the 0.2.x releases if you plan on using it in Rails <= 3.0.x
DEPRECATION WARNING: config.action_controller.session= has been deprecated. Please use config.session_store(name, options) instead. (called from <class:Application> at /home/chmarus/Pulpit/mmo/config/application.rb:54)
DEPRECATION WARNING: Rake tasks in /home/chmarus/Pulpit/mmo/vendor/plugins/event_calendar/tasks/event_calendar_tasks.rake are deprecated. Use lib/tasks instead. (called from <top (required)> at /home/chmarus/Pulpit/mmo/Rakefile:7)
** Invoke rails:upgrade:routes (first_time)
** Execute rails:upgrade:routes
rake aborted!
undefined method `now' for nil:NilClass
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:47:in `module_eval'
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:18:in `draw'
(eval):1:in `upgrade_routes'
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:47:in `module_eval'
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:47:in `upgrade_routes'
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/routes_upgrader.rb:28:in `generate_new_routes'
/home/chmarus/Pulpit/mmo/vendor/plugins/rails_upgrade/lib/tasks/rails_upgrade_tasks.rake:29:in `block (3 levels) in <top (required)>'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:636:in `block in execute'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:597:in `block in invoke_with_call_chain'
/home/chmarus/.rvm/rubies/ruby-head/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2029:in `block (2 levels) in top_level'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2029:in `block in top_level'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2001:in `block in run'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/home/chmarus/.rvm/gems/ruby-head#rails3/gems/rake-0.8.7/bin/rake:31:in `<top (required)>'
/home/chmarus/.rvm/gems/ruby-head#rails3/bin/rake:19:in `load'
/home/chmarus/.rvm/gems/ruby-head#rails3/bin/rake:19:in `<main>'
That error is occurring when it parses your routes.rb file. Look out for the now keyword in config/routes.rb. See https://github.com/rails/rails_upgrade/blob/master/lib/routes_upgrader.rb#L38 line 47.
If you don't see the call to now or don't know how to fix it from there, edit the question and post your routes.rb file, leave a comment, and we can take a closer look.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Rails 2.3-style plugins and deprecation warnings running task in Heroku
I am running rake db:migrate gives me the following warnings and then aborts:
$ heroku rake db:migration --trace
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support forthese plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/Rakefile:7)
rake aborted!
Don't know how to build task 'db:migration'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/task_manager.rb:49:in `[]'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:115:in`invoke_task'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/app/.bundle/gems/ruby/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/app/.bundle/gems/ruby/1.9.1/bin/rake:19:in `load'
/app/.bundle/gems/ruby/1.9.1/bin/rake:19:in `<main>'
when I checked vendor/plugins folder I only found a file called .gitkeep and is empty
As an FYI in case people arrive here from search engines due to the question title.
The deprecation warning is caused by Heroku injecting plugins - see Jared Beck's answer on this question: Rails 2.3-style plugins and deprecation warnings running task in Heroku
The solution proposed by nzifab above is valid for the underlying issue but this wasn't what was raised in the question title
vendor/plugins isn't the problem here, those are only warnins. It's heroku run rake db:migrate..
possibly just heroku rake db:migrate if you're not on the Cedar stack (note migrate, not migration)
What I feel of this is,
You must have made some changes in any of the gems and copied the hierarchy and the files with changes in the "..app/vendor/plugins" folder.
If this is the case, then this is just a warning to tell that you should copy plugins in "lib" folder.
You must have seen the same when you start you webrick in development mode.