在尝试部署到heroku时获得`无效的多字节字符(US-ASCII)(SyntaxError)

时间:2013-07-29 15:15:17

标签: ruby-on-rails ruby heroku authlogic

我的Gemfile中有以下行:

gem 'authlogic', :git => "git://github.com/binarylogic/authlogic.git"

当我推送到heroku时,我收到以下错误:

2013-07-29T15:09:28.895063+00:00 heroku[web.1]: State changed from crashed to starting
2013-07-29T15:09:32.231844+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -R config.ru -e $RAILS_ENV -p 14117`
2013-07-29T15:09:35.063805+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic.rb:60:in `require': /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic/regex.rb:15: invalid multibyte char (US-ASCII) (SyntaxError)
2013-07-29T15:09:35.063805+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic/regex.rb:15: invalid multibyte char (US-ASCII)
2013-07-29T15:09:35.063805+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic/regex.rb:15: syntax error, unexpected $end, expecting keyword_end
2013-07-29T15:09:35.063805+00:00 app[web.1]: ...'(?:[A-Z]{2,4}|museum|travel|онлайн)'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `block in require'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from config.ru:3:in `block in <main>'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
2013-07-29T15:09:35.063805+00:00 app[web.1]: ...                               ^
2013-07-29T15:09:35.063805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic.rb:60:in `block in <top (required)>'
2013-07-29T15:09:35.063805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic.rb:6:in `each'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from config.ru:1:in `<main>'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:71:in `start'
2013-07-29T15:09:35.063805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `require'
2013-07-29T15:09:35.063805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/runtime.rb:72:in `block (2 levels) in require'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/runtime.rb:70:in `each'
2013-07-29T15:09:35.065084+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `<main>'
2013-07-29T15:09:35.063805+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bundler/gems/authlogic-e4b2990d6282/lib/authlogic.rb:6:in `<top (required)>'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `each'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler/runtime.rb:59:in `require'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/bundler-1.3.2/lib/bundler.rb:132:in `require'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/config/environment.rb:3:in `require'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/config/environment.rb:3:in `<top (required)>'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from config.ru:3:in `require'
2013-07-29T15:09:35.064199+00:00 app[web.1]:    from /app/config/application.rb:8:in `<top (required)>'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from config.ru:1:in `new'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:181:in `load_rackup_config'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
2013-07-29T15:09:35.065084+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
2013-07-29T15:09:35.064496+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
2013-07-29T15:09:35.065084+00:00 app[web.1]:    from /app/vendor/bundle/ruby/1.9.1/bin/thin:23:in `load'
2013-07-29T15:09:36.377852+00:00 heroku[web.1]: State changed from starting to crashed
2013-07-29T15:09:36.336374+00:00 heroku[web.1]: Process exited with status 1

当然,该应用程序不起作用。

有关可能导致此问题的任何想法?因为乍一看,它可能来自AuthLogic(https://github.com/binarylogic/authlogic)代码。


更新

行。最奇怪的事情发生了。它始于它自己。看来我只需要给它一些时间,它现在正在工作......

将此留给今后遇到同样问题的人。

但是,知道导致AuthLogic错误的原因会很好。

1 个答案:

答案 0 :(得分:0)

似乎只是替换

gem 'authlogic', :git => "git://github.com/binarylogic/authlogic.git"

gem 'authlogic'

然后

rm Gemfile.lock
bundle install
git push heroku master

导致应用启动。