gpt4 book ai didi

ruby-on-rails - 为什么我得到远程 : sh: 2: Syntax error: Unterminated quoted string when I ran git push heroku master

转载 作者:太空狗 更新时间:2023-10-29 13:14:01 31 4
gpt4 key购买 nike

我正在使用 Rails 4.0.0.rc2 和 Ruby 1.9.3 我已经创建了应用程序,并且我已经使用 git push 将该应用程序推送到 GitHub 存储库。

当我尝试使用 git push heroku master 命令时,出现以下错误:

C:\Sites\first_app>git push heroku master
Counting objects: 101, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (92/92), done.
Writing objects: 100% (101/101), 21.02 KiB, done.
Total 101 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: sh: 2: Syntax error: Unterminated quoted string
remote: !
remote: ! There was an error parsing your Gemfile, we cannot continue
remote: ! --- ERROR REPORT TEMPLATE ---------------------------------------------------
remote: ! - What did you do?
remote: !
remote: ! I ran the command `/tmp/d20151213-205-1wyxt7v/bundler-1.9.7/bin/b
undle check`
remote: !
remote: ! - What did you expect to happen?
remote: !
remote: ! I expected Bundler to...
remote: !
remote: ! - What happened instead?
remote: !
remote: ! Instead, what actually happened was...
remote: !
remote: !
remote: ! Error details
remote: !
remote: ! LocalJumpError: no block given (yield)
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/b
undler/dsl.rb:166:in `group'
remote: ! /tmp/build_2e1664b3e9f6ede5a8c91d27f6a70ce3/Gemfile:11:in `eval_gemfile'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/dsl.rb:32:in `instance_eval'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/dsl.rb:32:in `eval_gemfile'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/dsl.rb:10:in `evaluate'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/definition.rb:25:in `build'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler.rb:155:in `definition'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/cli/check.rb:11:in `run'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/cli.rb:103:in `check'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/cli.rb:10:in `start'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/bin/bundle:20:in `block in <top (required)>'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/gems/bundler-1.9.7/bin/bundle:18:in `<top (required)>'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/bin/bundle:23:in `load'
remote: ! /tmp/d20151213-205-1wyxt7v/bundler-1.9.7/bin/bundle:23:in `<main>'
remote: !
remote: ! Environment
remote: !
remote: ! Bundler 1.9.7
remote: ! Rubygems 2.4.5.1
remote: ! Ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
remote: ! GEM_HOME /tmp/build_2e1664b3e9f6ede5a8c91d27f6a70ce3/vendor/bundle
remote: ! GEM_PATH
remote: ! Git 1.9.1
remote: !
remote: ! Bundler settings
remote: !
remote: ! frozen
remote: ! Set for the current user (/app/.bundle/config): "1"
remote: ! path
remote: ! Set for the current user (/app/.bundle/config): "vendor/bundle"
remote: ! bin
remote: ! Set for the current user (/app/.bundle/config): "vendor/bundle/bin"
remote: ! jobs
remote: ! Set for the current user (/app/.bundle/config): "4"
remote: ! without
remote: ! Set for the current user (/app/.bundle/config): "development:test"
remote: ! disable_shared_gems
remote: ! Set for the current user (/app/.bundle/config): "1"
remote: ! gemfile
remote: ! Set via BUNDLE_GEMFILE: "/tmp/build_2e1664b3e9f6ede5a8c91d27f6a70ce3/Gemfile"
remote: ! --- TEMPLATE END ----------------------------------------------------------------
remote: !
remote: ! Unfortunately, an unexpected error occurred, and Bundler cannot continue.
remote: !
remote: ! First, try this link to see if there are any existing issue reports for this error:
remote: ! https://github.com/bundler/bundler/search?q=no+block+given+%28yield%29&type=Issues
remote: !
remote: ! If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
remote: ! https://github.com/bundler/bundler/issues/new
remote: !
remote:
remote: ! Push rejected, failed to compile Ruby app
remote:
remote: Verifying deploy...
remote:
remote: ! Push rejected to arcane-coast-8104.
remote:
To https://git.heroku.com/arcane-coast-8104.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/arcane-coast-8104.git

当我使用heroku open 命令时

我得到了这个页面

heroku open

这是怎么回事?

我怎样才能部署到 Heroku?

下面是我的整个gemfile源

source 'https://rubygems.org'    
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.rc2'

#Add Bootstrap for pretty UI
gem 'bootstrap-sass', '2.3.2'

# Use sqlite3 as the database for Active Record
gem 'sqlite3', group: [:development, :test]
gem 'pg', group: :production
gem 'rails_12factor', group: :production

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0.rc2'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

#force for now
gem 'sprockets', '=2.11.0'

gem 'heroku', '~> 3.42', '>= 3.42.25'

group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

我的本​​地主机截图 localhost:3000

最佳答案

您的 Heroku 环境中很可能有一个 .env 文件,其中包含一个带有未终止字符串的变量声明。这由 dotenv 评估并导致您的 Gemfile 出现问题。

关于ruby-on-rails - 为什么我得到远程 : sh: 2: Syntax error: Unterminated quoted string when I ran git push heroku master,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34248535/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com