2015-12-13 13 views
6

Sto usando Rails 4.0.0.rc2 e Ruby 1.9.3 Ho creato un'applicazione e ho inviato questa applicazione a Repository GitHub utilizzando git push.Perché ottengo il controllo remoto: sh: 2: Errore di sintassi: stringa quotata non terminata quando eseguo git push heroku master

Quando tento il padrone comando git push Heroku ottengo il seguente errore:

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 

e quando utilizzare Heroku aperta comando

ho avuto questa pagina

heroku open

cosa sta succedendo?

Come posso distribuire in Heroku?

Di seguito tutta la mia fonte 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] 

mio localhost screenshot localhost:3000

+1

Forse un errore nella Gemfile (attorno alla riga 11). Quelle sono anche alcune versioni davvero vecchie/dispari da usare. –

+0

Qui di seguito è la mia fonte Gemfile attorno alla riga 11, non ho trovato alcun errore # Usa sqlite3 come database per Active Record gruppo: sviluppo,: test di fare gioiello 'sqlite3' fine Gruppo: Produzione fare gem 'pg' gem 'rails_12factor' fine –

+0

aggiungi il tuo intero 'Gemfile' –

risposta

2

E 'probabile che si dispone di un file .env nell'ambiente Heroku, che contiene una dichiarazione di variabile con una stringa non terminata. Questo viene valutato da dotenv e causa problemi con il tuo Gemfile.

+0

Meraviglioso. Come lo aggiustate? – gangelo

+0

1) individua i file '.env' 2) trova le stringhe non terminate 3) correggi quelli. – javabrett

+0

come trovare stringhe non terminate? –

0

Basta aggiungere il seguente gemma al file gemma:

gem 'net-ssh' 
2

Nel mio caso avevo aggiunto un compito rastrello che è stato richiedendo RSpec. Un salvataggio sulla LoadError doveva verificarsi bc rspec era solo in fase di sviluppo e di test, non la produzione in questo modo:

begin 
require "rspec/core/rake_task" 
    desc "Run all examples" 
    RSpec::Core::RakeTask.new(:spec) do |t| 
    t.rspec_opts = %w[--color] 
    t.pattern = 'spec/**/*_spec.rb' 
    end 
rescue LoadError 
end 

Più documentazione here

Problemi correlati