imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.31k stars 2.62k forks source link

rake script fail when deployed to production environment #1439

Open denvazh opened 10 years ago

denvazh commented 10 years ago

I faced this error when tried to normally deploy application to heroku ( as it was suggested in the documentation ):

Could not detect rake tasks
       ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
       and using the production group of your Gemfile.
       This may be intentional, if you expected rake tasks to be run
       cancel the build (CTRL+C) and fix the error then commit the fix:
       rake aborted!
       cannot load such file -- stringex
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/Rakefile:3:in `require'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/Rakefile:3:in `<top (required)>'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/rake_module.rb:25:in `load'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/rake_module.rb:25:in `load_rakefile'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:604:in `raw_load_rakefile'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:89:in `block in load_rakefile'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:88:in `load_rakefile'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:72:in `block in run'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
       /tmp/build_73690480-fdc4-4127-927b-7b12d2733cf6/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:70:in `run'

I looked inside Rakefile and found these lines:

require "rubygems"
require "bundler/setup"
require "stringex"

Obviously, it is expected to be installed. However, in Gemfile it is set to be installed only for development, hence the error.

group :development do
       [...]
       gem 'stringex', '~> 1.4.0'
end

If stringex is used not only for development, then it should be moved out from development group.

tamouse commented 10 years ago

I cannot reproduce this with a fresh install and fresh heroku app.

Can you please show the steps you took exactly? (Pasting the bash history would be helpful, for example.)

Also, is this a first time deployment or have you been deploying successfully to heroku before this?

The rake tasks should only be run in development mode, which is the environment one would write posts and generate their site in. On the heroku side, no rake tasks should be run, as it will be serving up the entire site from the public directory as it does with any Rack application.

denvazh commented 10 years ago

Sorry, for taking some time to follow-up.

It was not my first time to deploy to heroku, however it was the very first time to deploy fresh install to fresh heroku app.

I have used steps from here: http://octopress.org/docs/deploying/heroku/ , however there are few differences:

1) heroku toolbelt was installed with homebrew 2) I'm using rbenv installed with homebrew 3) rbenv is managing system wide ruby install

$: rbenv versions
  system
* 2.0.0-p195 (set by /usr/local/var/rbenv/version)

4) all gems are installed below corresponding project directory with bundler, only gem I install with 'gem install' command was bundler itself 5) bundler setup for my user

$: cat ~/.bundle/config 
---
BUNDLE_PATH: .bundle
BUNDLE_BIN: .bin

Below I've put log of steps I took

[~/devel/Private/blog]$: git clone git@github.com:imathis/octopress.git test_install
Cloning into 'test_install'...
remote: Counting objects: 10963, done.
remote: Compressing objects: 100% (5102/5102), done.
remote: Total 10963 (delta 5804), reused 9842 (delta 4985)
Receiving objects: 100% (10963/10963), 2.46 MiB | 784.00 KiB/s, done.
Resolving deltas: 100% (5804/5804), done.
Checking connectivity... done
[~/devel/Private/blog]$: cd test_install/

[~/devel/Private/blog/test_install]
{master 64ba603}$: git remote add heroku git@heroku.com:protected-springs-6919.git

[~/devel/Private/blog/test_install]
{master 64ba603}$: git fetch --all
Fetching origin
Fetching heroku
Initializing repository, done.

[~/devel/Private/blog/test_install]
{master 64ba603}$: vi .gitignore 

# comment: here I removed "public" entry from gitignore file

[~/devel/Private/blog/test_install]
{master 64ba603}$: rake generate
Could not find rake-0.9.2.2 in any of the sources
Run `bundle install` to install missing gems.

[~/devel/Private/blog/test_install]
{master 64ba603}$: bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/..
Installing rake (0.9.2.2) 
Installing RedCloth (4.2.9) 
Installing chunky_png (1.2.5) 
Installing fast-stemmer (1.0.1) 
Installing classifier (1.3.3) 
Installing fssm (0.2.9) 
Installing sass (3.2.9) 
Installing compass (0.12.2) 
Installing directory_watcher (1.4.1) 
Installing haml (3.1.7) 
Installing kramdown (0.13.8) 
Installing liquid (2.3.0) 
Installing syntax (1.0.0) 
Installing maruku (0.6.1) 
Installing posix-spawn (0.3.6) 
Installing yajl-ruby (1.1.0) 
Installing pygments.rb (0.3.4) 
Installing jekyll (0.12.0) 
Installing rack (1.5.2) 
Installing rack-protection (1.5.0) 
Installing rb-fsevent (0.9.1) 
Installing rdiscount (2.0.7.3) 
Installing rubypants (0.2.0) 
Installing sass-globbing (1.0.0) 
Installing tilt (1.3.7) 
Installing sinatra (1.4.2) 
Installing stringex (1.4.0) 
Using bundler (1.3.5) 
Your bundle is complete!
It was installed into ./.bundle

[~/devel/Private/blog/test_install]
{master 64ba603}$: rake generate
rake aborted!
You have already activated rake 0.9.6, but your Gemfile requires rake 0.9.2.2. Using bundle exec may solve this.
/Users/denvazh/devel/Private/blog/test_install/Rakefile:2:in `<top (required)>'
(See full trace by running task with --trace)

[~/devel/Private/blog/test_install]
{master 64ba603}$: bundle exec rake generate
rake aborted!
### You haven't set anything up yet. First run `rake install` to set up an Octopress theme.

Tasks: TOP => generate
(See full trace by running task with --trace)

[~/devel/Private/blog/test_install]
{master 64ba603}$: bundle exec rake install
## Copying classic theme into ./source and ./sass
mkdir -p source
cp -r .themes/classic/source/. source
mkdir -p sass
cp -r .themes/classic/sass/. sass
mkdir -p source/_posts
mkdir -p public

[~/devel/Private/blog/test_install]
{master 64ba603}$: bundle exec rake generate
## Generating Site with Jekyll
directory source/stylesheets/ 
   create source/stylesheets/screen.css 
Configuration from /Users/denvazh/devel/Private/blog/test_install/_config.yml
Building site: source -> public
Successfully generated site: source -> public

[~/devel/Private/blog/test_install]
{master 64ba603}$: git add .

[~/devel/Private/blog/test_install]
{master 64ba603}$: git commit -m 'site updated'
[master 0ea7415] site updated
 196 files changed, 4171 insertions(+), 1 deletion(-)
 create mode 100755 .bin/compass
 create mode 100755 .bin/dw
 create mode 100755 .bin/haml
 create mode 100755 .bin/html2haml
 create mode 100755 .bin/jekyll
 create mode 100755 .bin/kramdown
 create mode 100755 .bin/maruku
 create mode 100755 .bin/marutex
 create mode 100755 .bin/posix-spawn-benchmark
 create mode 100755 .bin/rackup
 create mode 100755 .bin/rake
 create mode 100755 .bin/rdiscount
 create mode 100755 .bin/redcloth
 create mode 100755 .bin/sass
 create mode 100755 .bin/sass-convert
 create mode 100755 .bin/scss
 create mode 100755 .bin/tilt
 create mode 100644 public/assets/jwplayer/glow/controlbar/background.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/blankButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/divider.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/fullscreenButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/fullscreenButtonOver.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/muteButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/muteButtonOver.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/normalscreenButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/normalscreenButtonOver.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/pauseButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/pauseButtonOver.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/playButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/playButtonOver.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/timeSliderBuffer.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/timeSliderCapLeft.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/timeSliderCapRight.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/timeSliderProgress.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/timeSliderRail.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/unmuteButton.png
 create mode 100644 public/assets/jwplayer/glow/controlbar/unmuteButtonOver.png
 create mode 100644 public/assets/jwplayer/glow/display/background.png
 create mode 100644 public/assets/jwplayer/glow/display/bufferIcon.png
 create mode 100644 public/assets/jwplayer/glow/display/muteIcon.png
 create mode 100644 public/assets/jwplayer/glow/display/playIcon.png
 create mode 100644 public/assets/jwplayer/glow/dock/button.png
 create mode 100644 public/assets/jwplayer/glow/glow.xml
 create mode 100644 public/assets/jwplayer/glow/playlist/item.png
 create mode 100644 public/assets/jwplayer/glow/playlist/itemOver.png
 create mode 100644 public/assets/jwplayer/glow/playlist/sliderCapBottom.png
 create mode 100644 public/assets/jwplayer/glow/playlist/sliderCapTop.png
 create mode 100644 public/assets/jwplayer/glow/playlist/sliderRail.png
 create mode 100644 public/assets/jwplayer/glow/playlist/sliderThumb.png
 create mode 100644 public/assets/jwplayer/glow/sharing/embedIcon.png
 create mode 100644 public/assets/jwplayer/glow/sharing/embedScreen.png
 create mode 100644 public/assets/jwplayer/glow/sharing/shareIcon.png
 create mode 100644 public/assets/jwplayer/glow/sharing/shareScreen.png
 create mode 100644 public/assets/jwplayer/player.swf
 create mode 100644 public/atom.xml
 create mode 100644 public/blog/archives/index.html
 create mode 100644 public/favicon.png
 create mode 100644 public/images/bird_32_gray.png
 create mode 100644 public/images/bird_32_gray_fail.png
 create mode 100644 public/images/code_bg.png
 create mode 100644 public/images/dotted-border.png
 create mode 100644 public/images/email.png
 create mode 100644 public/images/line-tile.png
 create mode 100644 public/images/noise.png
 create mode 100644 public/images/rss.png
 create mode 100644 public/images/search.png
 create mode 100644 public/index.html
 create mode 100644 public/javascripts/github.js
 create mode 100644 public/javascripts/libs/jXHR.js
 create mode 100644 public/javascripts/libs/jquery.min.js
 create mode 100644 public/javascripts/libs/swfobject-dynamic.js
 create mode 100644 public/javascripts/modernizr-2.0.js
 create mode 100644 public/javascripts/octopress.js
 create mode 100644 public/javascripts/pinboard.js
 create mode 100644 public/javascripts/twitter.js
 create mode 100644 public/robots.txt
 create mode 100644 public/sitemap.xml
 create mode 100644 public/stylesheets/screen.css
 create mode 100644 sass/_base.scss
 create mode 100644 sass/_partials.scss
 create mode 100644 sass/base/_layout.scss
 create mode 100644 sass/base/_solarized.scss
 create mode 100644 sass/base/_theme.scss
 create mode 100644 sass/base/_typography.scss
 create mode 100644 sass/base/_utilities.scss
 create mode 100644 sass/custom/_colors.scss
 create mode 100644 sass/custom/_fonts.scss
 create mode 100644 sass/custom/_layout.scss
 create mode 100644 sass/custom/_styles.scss
 create mode 100644 sass/partials/_archive.scss
 create mode 100644 sass/partials/_blog.scss
 create mode 100644 sass/partials/_footer.scss
 create mode 100644 sass/partials/_header.scss
 create mode 100644 sass/partials/_navigation.scss
 create mode 100644 sass/partials/_sharing.scss
 create mode 100644 sass/partials/_sidebar.scss
 create mode 100644 sass/partials/_syntax.scss
 create mode 100644 sass/partials/sidebar/_base.scss
 create mode 100644 sass/partials/sidebar/_delicious.scss
 create mode 100644 sass/partials/sidebar/_googleplus.scss
 create mode 100644 sass/partials/sidebar/_pinboard.scss
 create mode 100644 sass/plugins/_plugins.scss
 create mode 100644 sass/screen.scss
 create mode 100644 source/_includes/after_footer.html
 create mode 100644 source/_includes/archive_post.html
 create mode 100644 source/_includes/article.html
 create mode 100644 source/_includes/asides/delicious.html
 create mode 100644 source/_includes/asides/github.html
 create mode 100644 source/_includes/asides/googleplus.html
 create mode 100644 source/_includes/asides/pinboard.html
 create mode 100644 source/_includes/asides/recent_posts.html
 create mode 100644 source/_includes/custom/after_footer.html
 create mode 100644 source/_includes/custom/asides/about.html
 create mode 100644 source/_includes/custom/category_feed.xml
 create mode 100644 source/_includes/custom/footer.html
 create mode 100644 source/_includes/custom/head.html
 create mode 100644 source/_includes/custom/header.html
 create mode 100644 source/_includes/custom/navigation.html
 create mode 100644 source/_includes/disqus.html
 create mode 100644 source/_includes/facebook_like.html
 create mode 100644 source/_includes/footer.html
 create mode 100644 source/_includes/google_analytics.html
 create mode 100644 source/_includes/google_plus_one.html
 create mode 100644 source/_includes/head.html
 create mode 100644 source/_includes/header.html
 create mode 100644 source/_includes/navigation.html
 create mode 100644 source/_includes/post/author.html
 create mode 100644 source/_includes/post/categories.html
 create mode 100644 source/_includes/post/date.html
 create mode 100644 source/_includes/post/disqus_thread.html
 create mode 100644 source/_includes/post/sharing.html
 create mode 100644 source/_includes/twitter_sharing.html
 create mode 100644 source/_layouts/category_index.html
 create mode 100644 source/_layouts/default.html
 create mode 100644 source/_layouts/page.html
 create mode 100644 source/_layouts/post.html
 create mode 100644 source/assets/jwplayer/glow/controlbar/background.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/blankButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/divider.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/fullscreenButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/fullscreenButtonOver.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/muteButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/muteButtonOver.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/normalscreenButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/normalscreenButtonOver.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/pauseButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/pauseButtonOver.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/playButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/playButtonOver.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/timeSliderBuffer.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/timeSliderCapLeft.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/timeSliderCapRight.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/timeSliderProgress.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/timeSliderRail.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/unmuteButton.png
 create mode 100644 source/assets/jwplayer/glow/controlbar/unmuteButtonOver.png
 create mode 100644 source/assets/jwplayer/glow/display/background.png
 create mode 100644 source/assets/jwplayer/glow/display/bufferIcon.png
 create mode 100644 source/assets/jwplayer/glow/display/muteIcon.png
 create mode 100644 source/assets/jwplayer/glow/display/playIcon.png
 create mode 100644 source/assets/jwplayer/glow/dock/button.png
 create mode 100644 source/assets/jwplayer/glow/glow.xml
 create mode 100644 source/assets/jwplayer/glow/playlist/item.png
 create mode 100644 source/assets/jwplayer/glow/playlist/itemOver.png
 create mode 100644 source/assets/jwplayer/glow/playlist/sliderCapBottom.png
 create mode 100644 source/assets/jwplayer/glow/playlist/sliderCapTop.png
 create mode 100644 source/assets/jwplayer/glow/playlist/sliderRail.png
 create mode 100644 source/assets/jwplayer/glow/playlist/sliderThumb.png
 create mode 100644 source/assets/jwplayer/glow/sharing/embedIcon.png
 create mode 100644 source/assets/jwplayer/glow/sharing/embedScreen.png
 create mode 100644 source/assets/jwplayer/glow/sharing/shareIcon.png
 create mode 100644 source/assets/jwplayer/glow/sharing/shareScreen.png
 create mode 100644 source/assets/jwplayer/player.swf
 create mode 100644 source/atom.xml
 create mode 100644 source/blog/archives/index.html
 create mode 100644 source/favicon.png
 create mode 100644 source/images/bird_32_gray.png
 create mode 100644 source/images/bird_32_gray_fail.png
 create mode 100644 source/images/code_bg.png
 create mode 100644 source/images/dotted-border.png
 create mode 100644 source/images/email.png
 create mode 100644 source/images/line-tile.png
 create mode 100644 source/images/noise.png
 create mode 100644 source/images/rss.png
 create mode 100644 source/images/search.png
 create mode 100644 source/index.html
 create mode 100644 source/javascripts/github.js
 create mode 100644 source/javascripts/libs/jXHR.js
 create mode 100644 source/javascripts/libs/jquery.min.js
 create mode 100644 source/javascripts/libs/swfobject-dynamic.js
 create mode 100644 source/javascripts/modernizr-2.0.js
 create mode 100644 source/javascripts/octopress.js
 create mode 100644 source/javascripts/pinboard.js
 create mode 100644 source/javascripts/twitter.js
 create mode 100644 source/robots.txt

[~/devel/Private/blog/test_install]
{master 0ea7415}$: git push heroku master
Initializing repository, done.
Counting objects: 4750, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2051/2051), done.
Writing objects: 100% (4750/4750), 1.20 MiB | 317.00 KiB/s, done.
Total 4750 (delta 2467), reused 4515 (delta 2320)

-----> Deleting 4 files matching .slugignore patterns.
-----> Ruby app detected
-----> Compiling Ruby/Rack
-----> Using Ruby version: ruby-2.0.0
-----> Installing dependencies using Bundler version 1.3.2
       New app detected loading default bundler cache
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Fetching gem metadata from https://rubygems.org/..........
       Fetching gem metadata from https://rubygems.org/..
       Using rack (1.5.2)
       Installing rack-protection (1.5.0)
       Installing tilt (1.3.7)
       Installing sinatra (1.4.2)
       Using bundler (1.3.2)
       Your bundle is complete! It was installed into ./vendor/bundle
       Bundle completed (9.20s)
       Cleaning up the bundler cache.
       Removing rails (4.0.1)
       Removing sass (3.2.12)
       Removing turbolinks (1.3.1)
       Removing activesupport (4.0.1)
       Removing sdoc (0.3.20)
       Removing rack-cache (1.2)
       Removing sass-rails (3.2.6)
       Removing activemodel (3.2.14)
       Removing railties (4.0.1)
       Removing rails_stdout_logging (0.0.2)
       Removing atomic (1.1.14)
       Removing mail (2.5.4)
       Removing coffee-script (2.2.0)
       Removing thor (0.18.1)
       Removing coffee-script-source (1.6.3)
       Removing actionpack (4.0.1)
       Removing rack (1.4.5)
       Removing tzinfo (0.3.38)
       Removing rack-ssl (1.3.3)
       Removing actionmailer (4.0.1)
       Removing journey (1.0.4)
       Removing rake (10.1.0)
       Removing unicorn (4.6.3)
       Removing kgio (2.8.1)
       Removing json (1.8.0)
       Removing activeresource (3.2.14)
       Removing pg (0.17.0)
       Removing thread_safe (0.1.3)
       Removing multi_json (1.8.0)
       Removing activerecord (4.0.1)
       Removing sprockets-rails (2.0.1)
       Removing tzinfo (0.3.37)
       Removing bcrypt-ruby (3.0.1)
       Removing sass-rails (4.0.1)
       Removing activemodel (4.0.1)
       Removing railties (3.2.14)
       Removing rails_serve_static_assets (0.0.1)
       Removing execjs (2.0.2)
       Removing nokogiri (1.6.0)
       Removing arel (4.0.1)
       Removing rdoc (3.12.2)
       Removing treetop (1.4.15)
       Removing mime-types (1.25)
       Removing erubis (2.7.0)
       Removing rails (3.2.14)
       Removing rack-test (0.6.2)
       Removing polyglot (0.3.3)
       Removing sass (3.2.10)
       Removing activerecord (3.2.14)
       Removing activerecord-deprecated_finders (1.0.3)
       Removing jquery-rails (3.0.4)
       Removing bcrypt-ruby (3.1.2)
       Removing raindrops (0.12.0)
       Removing coffee-rails (3.2.2)
       Removing puma (2.6.0)
       Removing minitest (4.7.5)
       Removing actionmailer (3.2.14)
       Removing rails_stdout_logging (0.0.3)
       Removing builder (3.0.4)
       Removing uglifier (2.2.1)
       Removing activesupport (3.2.14)
       Removing uglifier (2.3.1)
       Removing actionpack (3.2.14)
       Removing json (1.8.1)
       Removing arel (3.0.2)
       Removing mini_portile (0.5.1)
       Removing multi_json (1.8.2)
       Removing jbuilder (1.5.2)
       Removing sprockets (2.2.2)
       Removing builder (3.1.4)
       Removing rails_12factor (0.0.2)
       Removing jbuilder (1.5.1)
       Removing tilt (1.4.1)
       Removing sprockets (2.10.0)
       Removing i18n (0.6.5)
       Removing hike (1.2.3)
       Removing coffee-rails (4.0.1)
       Removing execjs (2.0.1)
       Could not detect rake tasks
       ensure you can run `$ bundle exec rake -P` against your app with no environment variables present
       and using the production group of your Gemfile.
       This may be intentional, if you expected rake tasks to be run
       cancel the build (CTRL+C) and fix the error then commit the fix:
       rake aborted!
       cannot load such file -- stringex
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/Rakefile:3:in `require'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/Rakefile:3:in `<top (required)>'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/rake_module.rb:25:in `load'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/rake_module.rb:25:in `load_rakefile'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:604:in `raw_load_rakefile'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:89:in `block in load_rakefile'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:88:in `load_rakefile'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:72:in `block in run'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:160:in `standard_exception_handling'
       /tmp/build_2ec98aad-c69d-4fc5-9905-6ff4f8c73492/vendor/ruby-2.0.0/lib/ruby/2.0.0/rake/application.rb:70:in `run'
       vendor/ruby-2.0.0/bin/rake:41:in `<main>'
-----> WARNINGS:
       You have not declared a Ruby version in your Gemfile.
       To set your Ruby version add this line to your Gemfile:
       ruby '2.0.0'
       # See https://devcenter.heroku.com/articles/ruby-versions for more information.
-----> Discovering process types
       Procfile declares types -> (none)
       Default types for Ruby  -> console, rake, web

-----> Compressing... done, 12.7MB
-----> Launching... done, v3
       http://protected-springs-6919.herokuapp.com deployed to Heroku

To git@heroku.com:protected-springs-6919.git
 * [new branch]      master -> master

I'd like to note, that every time application gets pushed to heroku it wants to run rake script and it always leads to an error. I guess it is not so critical, because all pages are saved below 'public' directory and as soon as application deployment was finished I can see pages normally:

$: curl http://protected-springs-6919.herokuapp.com

<!DOCTYPE html>
<!--[if IEMobile 7 ]><html class="no-js iem7"><![endif]-->
<!--[if lt IE 9]><html class="no-js lte-ie8"><![endif]-->
<!--[if (gt IE 8)|(gt IEMobile 7)|!(IEMobile)|!(IE)]><!--><html class="no-js" lang="en"><!--<![endif]-->
<head>
  <meta charset="utf-8">
  <title>My Octopress Blog</title>
  <meta name="author" content="Your Name">
[...]
EpsilonX commented 10 years ago

@denvazh I've met the same problem: rake failed due to cannot find 'stringex' As I've move 'stringex' out of development in Gemfile, the problem is fixed!~

Thanks a lot!~

twissmueller commented 10 years ago

@EpsilonX I can confirm that. Just ran into the same problem and with your solution problem was fixed. Thanks!

statwonk commented 10 years ago

:+1: Third instance of exact bug. Moving 'stringex' out of the development group fixes it.

eduncan911 commented 10 years ago

For me, I changed my .bundle/config file in my project to remove "development".

From what I understand, doing this will now install any gems defined under development - and it got my Octopress (aka Jekyll) site working again. I don't know alot about Ruby and gems, but the file is:

source "http://rubygems.org"

group :development do
  gem 'rake', '~> 0.9'
  gem 'jekyll', '~> 0.12'
  gem 'rdiscount', '~> 2.0.7'
  gem 'pygments.rb', '~> 0.3.4'
  gem 'RedCloth', '~> 4.2.9'
  gem 'haml', '~> 3.1.7'
  gem 'compass', '~> 0.12.2'
  gem 'sass', '~> 3.2'
  gem 'sass-globbing', '~> 1.0.0'
  gem 'rubypants', '~> 0.2.0'
  gem 'rb-fsevent', '~> 0.9'
  gem 'stringex', '~> 1.4.0'
  gem 'liquid', '~> 2.3.0'
  gem 'directory_watcher', '1.4.1'
  gem 'redcarpet', '~> 2.3'
  gem 'albino', '~> 1.3'
end

Looks to me that is defined in a group of development. And it looks by default that the bundler ignores development.

Again, I don't know a lot about Ruby and gems and bundler; but, it would seem a "hackers blog" setup like this Octopress and Jekyll should not have these gems listed under development, when the bundler is excludes it by default. Makes us hackers hacked off.

danielricecodes commented 10 years ago

I solved this a different way than changing your app's Gemfile and introducing dependencies onto your production system that are not used. These rake tasks defined in Rakefile are only used locally to generate the blog content under /public, so I simply modified .slugignore and added Rakefile to it.

Now when Heroku compiles, it discards the Rakefile and does not present this warning. No Gemfile modifications required. That said, I do not think that #1541 is the right approach. This could be solved by updating the Deploying on Heroku documentation instead or by modifying the boilerplate .slugignore.

johannesdwicahyo commented 10 years ago

I agree with @danielricecodes Fix with adding "Rakefile" to .slugignore

statwonk commented 10 years ago

@danielricecodes that feels like the best method to me, too! :thumbsup: I closed the PR: https://github.com/imathis/octopress/pull/1541

ksingh7 commented 9 years ago

@danielricecodes thanks your fix did the trick , you rock :+1: