热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

无法将Rails应用程序推送到Heroku-发布预编译资产-UnabletoPushRailsApptoHeroku-IssuePrecompilingAssets

ImprettynewtobothRubyandRails,sothankyoufortakingthetimetoreadmyquestion.我对Ruby

I'm pretty new to both Ruby and Rails, so thank you for taking the time to read my question.

我对Ruby和Rails都很陌生,所以感谢您花时间阅读我的问题。

My issue is that I'm unable to push a Rails app to Heroku. When I try, I get the following message.

我的问题是我无法将Rails应用程序推送到Heroku。当我尝试时,我收到以下消息。


> C:\RailsNew\mcl101>git push heroku master
Fetching repository, done.
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 353 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.0.0
-----> Warning:
       Removing `Gemfile.lock` because it was generated on Windows.
       Bundler will do a full resolve so native gems are handled properly.
       This may result in unexpected gem versions being used in your app.
       In rare occasions Bundler may not be able to resolve your dependencies at
 all.
       http[ed: removed link to to insufficient rep]...
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle -
-binstubs vendor/bundle/bin
       Fetching gem metadata from [ed: removed link due to insufficient rep]...........
       Fetching gem metadata from [ed: removed link due to insufficient rep]...
       Resolving dependencies...
       Using rake (10.1.1)
       Using i18n (0.6.9)
       Using multi_json (1.8.2)
       Using activesupport (3.2.14)
       Using builder (3.0.4)
       Using activemodel (3.2.14)
       Using erubis (2.7.0)
       Using journey (1.0.4)
       Using rack (1.4.5)
       Using rack-cache (1.2)
       Using rack-test (0.6.2)
       Using hike (1.2.3)
       Using tilt (1.4.1)
       Using sprockets (2.2.2)
       Using actionpack (3.2.14)
       Using mime-types (1.25.1)
       Using polyglot (0.3.3)
       Using treetop (1.4.15)
       Using mail (2.5.4)
       Using actionmailer (3.2.14)
       Using arel (3.0.3)
       Using tzinfo (0.3.38)
       Using activerecord (3.2.14)
       Using activeresource (3.2.14)
       Using bundler (1.3.2)
       Using coffee-script-source (1.6.3)
       Using execjs (2.0.2)
       Using coffee-script (2.2.0)
       Using rack-ssl (1.3.3)
       Using json (1.8.1)
       Using rdoc (3.12.2)
       Using thor (0.18.1)
       Using railties (3.2.14)
       Using coffee-rails (3.2.2)
       Using jquery-rails (2.0.2)
       Using pg (0.12.2)
       Using rails (3.2.14)
       Using rails_serve_static_assets (0.0.2)
       Using rails_stdout_logging (0.0.3)
       Using rails_12factor (0.0.2)
       Using sass (3.2.13)
       Using sass-rails (3.2.5)
       Using uglifier (1.2.3)
       Your bundle is complete! It was installed into ./vendor/bundle
       Bundle completed (6.76s)
       Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       Running: rake assets:precompile
       Connecting to database specified by DATABASE_URL
       Compiled jquery.js  (3ms)  (pid 700)
       Compiled jquery_ujs.js  (0ms)  (pid 700)
       Compiled static_pages.js  (0ms)  (pid 700)
       Compiled application.js  (15ms)  (pid 700)
       rake aborted!
       Unexpected character '#' (line: 9783, col: 1, pos: 268384)
       Error
       at new JS_Parse_Error (/tmp/execjs20140102-700-pswwm7.js:497:22)
       at js_error (/tmp/execjs20140102-700-pswwm7.js:505:15)
       at parse_error (/tmp/execjs20140102-700-pswwm7.js:597:17)
       at Object.next_token [as input] (/tmp/execjs20140102-700-pswwm7.js:839:17
)
       at next (/tmp/execjs20140102-700-pswwm7.js:943:37)
       at Object.semicolon [as 1] (/tmp/execjs20140102-700-pswwm7.js:986:38)
       at prog1 (/tmp/execjs20140102-700-pswwm7.js:1530:28)
       at simple_statement (/tmp/execjs20140102-700-pswwm7.js:1123:35)
       at /tmp/execjs20140102-700-pswwm7.js:1039:40
       at /tmp/execjs20140102-700-pswwm7.js:1513:32
       (in /tmp/build_364edaac-c703-4702-b865-9a776254c355/app/assets/Javascript
s/application.js)/tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/r
uby/2.0.0/gems/execjs-2.0.2/lib/execjs/external_runtime.rb:68:in `extract_result
'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/execjs-2.0.2/lib/execjs/external_runtime.rb:28:in `block in exec'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/execjs-2.0.2/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/execjs-2.0.2/lib/execjs/external_runtime.rb:27:in `exec'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/uglifier-1.2.3/lib/uglifier.rb:101:in `compile'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/compressors.rb:74:in `compress'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/processing.rb:265:in `block in js_compressor=
'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/tilt-1.4.1/lib/tilt/template.rb:103:in `render'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/static_compiler.rb:19:in `block in compile'

       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file
'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/static_compiler.rb:18:in `compile'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/assets.rake:56:in `internal_precompile'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/assets.rake:70:in `block (3 levels) in '
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/assets.rake:60:in `block (3 levels) in '
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_ta
sk'
       /tmp/build_364edaac-c703-4702-b865-9a776254c355/vendor/bundle/ruby/2.0.0/
gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in '
       Tasks: TOP => assets:precompile:primary
       (See full trace by running task with --trace)
 !
 !     Precompiling assets failed.
 !

 !     Push rejected, failed to compile Ruby app


To git@heroku.com:sheltered-brushlands-4377.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:sheltered-brushlands-4377.git

Doing a bit of research on here, and by looking at the error, it seemed that the problem was something to do with precompiling of assets.

在这里做一些研究,通过查看错误,似乎问题与预编译资产有关。

So I added the following code to ../config/application.rb:

所以我将以下代码添加到../config/application.rb:

config.assets.initialize_on_precompile = false

This seemed to work, as I was now able to push my app to Heroku. But now when I try to visit the site, I get an application error, which says that my app cannot be served. So I ran the logs:

这似乎有效,因为我现在能够将我的应用程序推送到Heroku。但是现在当我尝试访问该网站时,我收到了一个应用程序错误,该错误表明我的应用程序无法提供。所以我运行了日志:

C:\RailsNew\mcl101>heroku logs
2014-01-02T13:31:50.786546+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0
.0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `'
2014-01-02T13:31:50.786546+00:00 app[web.1]:    from script/rails:6:in `require'

2014-01-02T13:31:52.037593+00:00 heroku[web.1]: Process exited with status 1
2014-01-02T13:31:52.056076+00:00 heroku[web.1]: State changed from starting to c
rashed
2014-01-02T15:16:11.842881+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path=/ host=sheltered-brushlands-4377.herokuapp.com fwd="204.15
2.207.170" dyno= cOnnect= service= status=503 bytes=
2014-01-02T15:30:24.407393+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path=/favicon.ico host=sheltered-brushlands-4377.herokuapp.com
fwd="204.152.207.170" dyno= cOnnect= service= status=503 bytes=
2014-01-02T15:30:21.620843+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path=/ host=sheltered-brushlands-4377.herokuapp.com fwd="204.15
2.207.170" dyno= cOnnect= service= status=503 bytes=
2014-01-02T15:30:25.174076+00:00 heroku[router]: at=error code=H10 desc="App cra
shed" method=GET path=/favicon.ico host=sheltered-brushlands-4377.herokuapp.com
fwd="204.152.207.170" dyno= cOnnect= service= status=503 bytes=
2014-01-02T15:36:06+00:00 heroku[slug-compiler]: Slug compilation started
2014-01-02T15:36:56.553763+00:00 heroku[api]: Deploy ba635d7 by j.knoll621@gmail
.com
2014-01-02T15:36:56.583136+00:00 heroku[api]: Release v7 created by j.knoll621@g
mail.com
2014-01-02T15:36:56+00:00 heroku[slug-compiler]: Slug compilation finished
2014-01-02T15:36:56.885265+00:00 heroku[web.1]: State changed from crashed to st
arting
2014-01-02T15:37:00.326555+00:00 heroku[web.1]: Starting process with command `b
undle exec rails server -p 48960`
2014-01-02T15:37:04.734154+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0
.0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap'
2014-01-02T15:37:04.734201+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0
.0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `'
2014-01-02T15:37:04.734257+00:00 app[web.1]:    from script/rails:6:in `require'

2014-01-02T15:37:04.734035+00:00 app[web.1]: /app/config/application.rb:4:in `': undefined local variable or method `config' for main:Object (Na
meError)
2014-01-02T15:37:04.734035+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0
.0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require'
2014-01-02T15:37:04.734154+00:00 app[web.1]:    from /app/vendor/bundle/ruby/2.0
.0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in '
2014-01-02T15:37:04.734257+00:00 app[web.1]:    from script/rails:6:in `
' 2014-01-02T15:37:06.097451+00:00 heroku[web.1]: Process exited with status 1 2014-01-02T15:37:09.142098+00:00 heroku[web.1]: Starting process with command `b undle exec rails server -p 30034` 2014-01-02T15:37:11.602040+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap' 2014-01-02T15:37:11.602040+00:00 app[web.1]: /app/config/application.rb:4:in `': undefined local variable or method `config' for main:Object (Na meError) 2014-01-02T15:37:11.602040+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in ' 2014-01-02T15:37:11.602040+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require' 2014-01-02T15:37:11.602040+00:00 app[web.1]: from script/rails:6:in `require' 2014-01-02T15:37:11.602040+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `' 2014-01-02T15:37:11.602040+00:00 app[web.1]: from script/rails:6:in `
' 2014-01-02T15:37:12.990230+00:00 heroku[web.1]: Process exited with status 1 2014-01-02T15:37:13.004552+00:00 heroku[web.1]: State changed from starting to c rashed 2014-01-02T15:37:06.115394+00:00 heroku[web.1]: State changed from starting to c rashed 2014-01-02T15:37:06.116811+00:00 heroku[web.1]: State changed from crashed to st arting 2014-01-02T15:48:01.013531+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path=/ host=sheltered-brushlands-4377.herokuapp.com fwd="204.15 2.207.170" dyno= cOnnect= service= status=503 bytes= 2014-01-02T15:48:08.089103+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path=/favicon.ico host=sheltered-brushlands-4377.herokuapp.com fwd="204.152.207.170" dyno= cOnnect= service= status=503 bytes= 2014-01-02T16:34:13.326232+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path=/ host=sheltered-brushlands-4377.herokuapp.com fwd="204.15 2.207.170" dyno= cOnnect= service= status=503 bytes= 2014-01-02T16:34:56.645390+00:00 heroku[api]: Starting process with command `bun dle exec rake db:migrate` by j.knoll621@gmail.com 2014-01-02T16:35:01.839866+00:00 heroku[run.5825]: Awaiting client 2014-01-02T16:35:01.838431+00:00 heroku[run.5825]: State changed from starting t o up 2014-01-02T16:35:01.918075+00:00 heroku[run.5825]: Starting process with command `bundle exec rake db:migrate` 2014-01-02T16:35:05.282643+00:00 heroku[run.5825]: Process exited with status 1 2014-01-02T16:35:05.296168+00:00 heroku[run.5825]: State changed from up to comp lete 2014-01-02T16:37:36.671768+00:00 heroku[api]: Starting process with command `bun dle exec rake db:migrate --trade` by j.knoll621@gmail.com 2014-01-02T16:37:40.391686+00:00 heroku[run.3032]: Awaiting client 2014-01-02T16:37:40.434212+00:00 heroku[run.3032]: State changed from starting t o up 2014-01-02T16:37:53.327294+00:00 heroku[run.1381]: State changed from starting t o up 2014-01-02T16:37:53.497702+00:00 heroku[run.1381]: Awaiting client 2014-01-02T16:37:56.108478+00:00 heroku[run.1381]: Starting process with command `bundle exec rake db:migrate --trace` 2014-01-02T16:37:58.606115+00:00 heroku[run.1381]: State changed from up to comp lete 2014-01-02T16:37:58.596113+00:00 heroku[run.1381]: Process exited with status 1 2014-01-02T16:37:49.190853+00:00 heroku[api]: Starting process with command `bun dle exec rake db:migrate --trace` by j.knoll621@gmail.com 2014-01-02T16:38:10.394260+00:00 heroku[run.3032]: Error R13 (Attach error) -> F ailed to attach to process 2014-01-02T16:38:11.687514+00:00 heroku[run.3032]: Process exited with status 12 8 2014-01-02T16:38:11.699991+00:00 heroku[run.3032]: State changed from up to comp lete 2014-01-02T16:42:23.044171+00:00 heroku[api]: Starting process with command `bun dle exec rake db:migrate --trace` by j.knoll621@gmail.com 2014-01-02T16:42:28.740441+00:00 heroku[run.5363]: Awaiting client 2014-01-02T16:42:28.791316+00:00 heroku[run.5363]: Starting process with command `bundle exec rake db:migrate --trace` 2014-01-02T16:42:28.887756+00:00 heroku[run.5363]: State changed from starting t o up 2014-01-02T16:42:31.377482+00:00 heroku[run.5363]: State changed from up to comp lete 2014-01-02T16:42:31.375346+00:00 heroku[run.5363]: Process exited with status 1 2014-01-02T16:49:47+00:00 heroku[slug-compiler]: Slug compilation started 2014-01-02T16:50:05+00:00 heroku[slug-compiler]: Slug compilation failed: failed to compile Ruby app 2014-01-02T16:52:07.680249+00:00 heroku[web.1]: State changed from crashed to st arting 2014-01-02T16:52:12.874719+00:00 heroku[web.1]: Starting process with command `b undle exec rails server -p 25475` 2014-01-02T16:52:16.269490+00:00 app[web.1]: /app/config/application.rb:4:in `': undefined local variable or method `config' for main:Object (Na meError) 2014-01-02T16:52:16.269490+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require' 2014-01-02T16:52:16.269490+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in ' 2014-01-02T16:52:16.269490+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap' 2014-01-02T16:52:16.269490+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `' 2014-01-02T16:52:16.269490+00:00 app[web.1]: from script/rails:6:in `require' 2014-01-02T16:52:16.269490+00:00 app[web.1]: from script/rails:6:in `
' 2014-01-02T16:52:17.887964+00:00 heroku[web.1]: Process exited with status 1 2014-01-02T16:52:17.933750+00:00 heroku[web.1]: State changed from starting to c rashed 2014-01-02T17:15:43+00:00 heroku[slug-compiler]: Slug compilation started 2014-01-02T17:16:16.064916+00:00 heroku[api]: Deploy a366609 by j.knoll621@gmail .com 2014-01-02T17:16:16.719947+00:00 heroku[api]: Release v8 created by j.knoll621@g mail.com 2014-01-02T17:16:16+00:00 heroku[slug-compiler]: Slug compilation finished 2014-01-02T17:16:21.356805+00:00 heroku[web.1]: Starting process with command `b undle exec rails server -p 6069` 2014-01-02T17:16:23.613703+00:00 app[web.1]: /app/config/application.rb:4:in `': undefined local variable or method `config' for main:Object (Na meError) 2014-01-02T17:16:23.613703+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap' 2014-01-02T17:16:23.613703+00:00 app[web.1]: from script/rails:6:in `require' 2014-01-02T17:16:23.613703+00:00 app[web.1]: from script/rails:6:in `
' 2014-01-02T17:16:23.613703+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require' 2014-01-02T17:16:23.613703+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in ' 2014-01-02T17:16:23.613703+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `' 2014-01-02T17:16:24.919650+00:00 heroku[web.1]: Process exited with status 1 2014-01-02T17:16:24.935954+00:00 heroku[web.1]: State changed from crashed to st arting 2014-01-02T17:16:24.935066+00:00 heroku[web.1]: State changed from starting to c rashed 2014-01-02T17:16:28.179246+00:00 heroku[web.1]: Starting process with command `b undle exec rails server -p 3013` 2014-01-02T17:16:30.438557+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `block in ' 2014-01-02T17:16:30.438773+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `' 2014-01-02T17:16:30.438878+00:00 app[web.1]: from script/rails:6:in `require' 2014-01-02T17:16:30.438235+00:00 app[web.1]: /app/config/application.rb:4:in `': undefined local variable or method `config' for main:Object (Na meError) 2014-01-02T17:16:30.438441+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:53:in `require' 2014-01-02T17:16:30.438665+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.0 .0/gems/railties-3.2.14/lib/rails/commands.rb:50:in `tap' 2014-01-02T17:16:30.438986+00:00 app[web.1]: from script/rails:6:in `
' 2014-01-02T17:16:31.716131+00:00 heroku[web.1]: Process exited with status 1 2014-01-02T17:16:31.727940+00:00 heroku[web.1]: State changed from starting to c rashed 2014-01-02T17:16:33.515811+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path=/ host=sheltered-brushlands-4377.herokuapp.com fwd="204.15 2.207.170" dyno= cOnnect= service= status=503 bytes= 2014-01-02T17:16:40.637813+00:00 heroku[router]: at=error code=H10 desc="App cra shed" method=GET path=/favicon.ico host=sheltered-brushlands-4377.herokuapp.com fwd="204.152.207.170" dyno= cOnnect= service= status=503 bytes=

Still not sure what the issue is. Here is rake db:migrate --trace as well

仍不确定问题是什么。这里是rake db:migrate --trace

C:\RailsNew\mcl101>heroku run rake db:migrate --trace
Running `rake db:migrate --trace` attached to terminal... up, run.1381
rake aborted!
undefined local variable or method `config' for main:Object
/app/config/application.rb:4:in `'
/app/Rakefile:5:in `require'
/app/Rakefile:5:in `'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/rake_module.rb:25:in `load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:637:in `raw_load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:94:in `block in load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `standard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:93:in `load_rakefile'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:77:in `block in run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:165:in `s
tandard_exception_handling'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
/app/vendor/bundle/ruby/2.0.0/gems/rake-10.1.1/bin/rake:33:in `'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/app/vendor/bundle/ruby/2.0.0/bin/rake:23:in `
'

Please let me know if you see anything in that I'm doing completely wrong. Any feedback or assistance would be much appreciated. I apologize if this question has been answered on here before. I found a few similar questions, but nothing that could help me, and I've been puzzling over this for the better part of a week.

如果你发现任何我完全错误的事情,请告诉我。任何反馈或帮助将不胜感激。如果此问题已在此处得到解答,我深表歉意。我发现了一些类似的问题,但没有任何可以帮助我的事情,而且我在一周的大部分时间里都对此感到困惑。

Thank you for your help.

感谢您的帮助。

1 个解决方案

#1


0  

Does your app run normally on localhost, it seems there is something wrong with your migrations. I'm saying this because of this line in the output => rake aborted! Unexpected character '#' (line: 9783, col: 1, pos: 268384) Error – Tom Hagen Jan 3 at 10:37

您的应用是否在localhost上正常运行,您的迁移似乎有问题。我这样说是因为输出中的这一行=> rake aborted!意外的字符'#'(行:9783,col:1,pos:268384)错误 - Tom Hagen 1月3日10:37

Thanks Tom. Your comment pointed me in the right direction and I figured out the problem. Closing the topic as there are already similar questions.

谢谢汤姆。你的评论指出了我正确的方向,我找出了问题所在。关闭主题,因为已经有类似的问题。


推荐阅读
  • Introduction(简介)Forbeingapowerfulobject-orientedprogramminglanguage,Cisuseda ... [详细]
  • 本文介绍了Java集合库的使用方法,包括如何方便地重复使用集合以及下溯造型的应用。通过使用集合库,可以方便地取用各种集合,并将其插入到自己的程序中。为了使集合能够重复使用,Java提供了一种通用类型,即Object类型。通过添加指向集合的对象句柄,可以实现对集合的重复使用。然而,由于集合只能容纳Object类型,当向集合中添加对象句柄时,会丢失其身份或标识信息。为了恢复其本来面貌,可以使用下溯造型。本文还介绍了Java 1.2集合库的特点和优势。 ... [详细]
  • 本文介绍了RPC框架Thrift的安装环境变量配置与第一个实例,讲解了RPC的概念以及如何解决跨语言、c++客户端、web服务端、远程调用等需求。Thrift开发方便上手快,性能和稳定性也不错,适合初学者学习和使用。 ... [详细]
  • Java在运行已编译完成的类时,是通过java虚拟机来装载和执行的,java虚拟机通过操作系统命令JAVA_HOMEbinjava–option来启 ... [详细]
  • 解决github访问慢的问题的方法集锦
    本文总结了国内用户在访问github网站时可能遇到的加载慢的问题,并提供了解决方法,其中包括修改hosts文件来加速访问。 ... [详细]
  • NotSupportedException无法将类型“System.DateTime”强制转换为类型“System.Object”
    本文介绍了在使用LINQ to Entities时出现的NotSupportedException异常,该异常是由于无法将类型“System.DateTime”强制转换为类型“System.Object”所导致的。同时还介绍了相关的错误信息和解决方法。 ... [详细]
  • linux进阶50——无锁CAS
    1.概念比较并交换(compareandswap,CAS),是原⼦操作的⼀种,可⽤于在多线程编程中实现不被打断的数据交换操作࿰ ... [详细]
  • 云原生应用最佳开发实践之十二原则(12factor)
    目录简介一、基准代码二、依赖三、配置四、后端配置五、构建、发布、运行六、进程七、端口绑定八、并发九、易处理十、开发与线上环境等价十一、日志十二、进程管理当 ... [详细]
  • Mono为何能跨平台
    概念JIT编译(JITcompilation),运行时需要代码时,将Microsoft中间语言(MSIL)转换为机器码的编译。CLR(CommonLa ... [详细]
  • php课程Json格式规范需要注意的小细节
    JSON(JavaScriptObjectNotation)是一种轻量级的数据交换格式。易于人阅读和编写。同时也易于机器解析和生成。它基于JavaScriptProgramming ... [详细]
  • const限定符全解一、const修饰普通变量  intconsta500;  constinta600;  上述两种情况相同,都是声明一个const型的变量,它们 ... [详细]
  • 本文介绍了在Windows环境下如何配置php+apache环境,包括下载php7和apache2.4、安装vc2015运行时环境、启动php7和apache2.4等步骤。希望对需要搭建php7环境的读者有一定的参考价值。摘要长度为169字。 ... [详细]
  • Android源码深入理解JNI技术的概述和应用
    本文介绍了Android源码中的JNI技术,包括概述和应用。JNI是Java Native Interface的缩写,是一种技术,可以实现Java程序调用Native语言写的函数,以及Native程序调用Java层的函数。在Android平台上,JNI充当了连接Java世界和Native世界的桥梁。本文通过分析Android源码中的相关文件和位置,深入探讨了JNI技术在Android开发中的重要性和应用场景。 ... [详细]
  • C++字符字符串处理及字符集编码方案
    本文介绍了C++中字符字符串处理的问题,并详细解释了字符集编码方案,包括UNICODE、Windows apps采用的UTF-16编码、ASCII、SBCS和DBCS编码方案。同时说明了ANSI C标准和Windows中的字符/字符串数据类型实现。文章还提到了在编译时需要定义UNICODE宏以支持unicode编码,否则将使用windows code page编译。最后,给出了相关的头文件和数据类型定义。 ... [详细]
  • 本文介绍了iOS数据库Sqlite的SQL语句分类和常见约束关键字。SQL语句分为DDL、DML和DQL三种类型,其中DDL语句用于定义、删除和修改数据表,关键字包括create、drop和alter。常见约束关键字包括if not exists、if exists、primary key、autoincrement、not null和default。此外,还介绍了常见的数据库数据类型,包括integer、text和real。 ... [详细]
author-avatar
拥有勒幷不代表幸福_563
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有