Neil
Neil

Reputation: 5178

Rails 4 in Action: unable to push code to heroku, sh: 2: Syntax error: Unterminated quoted string

I am working through the Rails 4 In Action Book. I am on chapter 13: Deployment, page 457 where you push your code up to heroku:

git push heroku master

It appears to successfully grab all the needed gems as it gets to this part:

remote:        Bundle complete! 27 Gemfile dependencies, 90 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (29.18s)
remote:        Cleaning up the bundler cache

But then right after that it blows up and says this:

remote: -----> Detecting rake tasks
remote: sh: 2: Syntax error: Unterminated quoted string
remote: sh: 2: Syntax error: Unterminated quoted string
remote:  !
remote:  !     Could not detect rake tasks
remote:  !     ensure you can run `$ bundle exec rake -P` against your app
remote:  !     and using the production group of your Gemfile.
remote:  !     rake aborted!
remote:  !     LoadError: cannot load such file -- net/ssh

I did what it suggested and ran bundle exec rake -P. Here was the output from that:

rake aborted!

LoadError: cannot load such file -- net/ssh

This is the tough part when working through a tutorial book. I do not think I missed any steps. I'm not sure what to do here. Any tips would be greatly appreciated.

Upvotes: 1

Views: 491

Answers (1)

Neil
Neil

Reputation: 5178

I figured it out and hope this helps anyone else having the same issue.

What eventually did it for me was that I had to update the fog gem. The book has you use version 1.29.0. For whatever reason: that version was not working for me.

In my Gemfile I simply put gem "fog", deleted my Gemfile.lock and ran bundle so that it would go out and grab the latest version.

Afterwards I looked inside the Gemfile.lock and noticed it grabbed the fog version of 1.38.0. Now when I ran git push heroku master it worked.

What led me to try out updating fog was this issue on the fog github page.

In case anyone was curious: I was using rails 4.2.1, as well as ruby 2.2.1 as the book tells you to.

Upvotes: 1

Related Questions