Skip Navigation
Show nav
Heroku Dev Center
  • Get Started
  • Documentation
  • Changelog
  • Search
  • Get Started
    • Node.js
    • Ruby on Rails
    • Ruby
    • Python
    • Java
    • PHP
    • Go
    • Scala
    • Clojure
  • Documentation
  • Changelog
  • More
    Additional Resources
    • Home
    • Elements
    • Products
    • Pricing
    • Careers
    • Help
    • Status
    • Events
    • Podcasts
    • Compliance Center
    Heroku Blog

    Heroku Blog

    Find out what's new with Heroku on our blog.

    Visit Blog
  • Log inorSign up
View categories

Categories

  • Heroku Architecture
    • Dynos (app containers)
    • Stacks (operating system images)
    • Networking & DNS
    • Platform Policies
    • Platform Principles
  • Command Line
  • Deployment
    • Deploying with Git
    • Deploying with Docker
    • Deployment Integrations
  • Continuous Delivery
    • Continuous Integration
  • Language Support
    • Node.js
    • Ruby
      • Working with Bundler
      • Rails Support
    • Python
      • Working with Django
      • Background Jobs in Python
    • Java
      • Working with Maven
      • Java Database Operations
      • Working with Spring Boot
      • Java Advanced Topics
    • PHP
    • Go
      • Go Dependency Management
    • Scala
    • Clojure
  • Databases & Data Management
    • Heroku Postgres
      • Postgres Basics
      • Postgres Getting Started
      • Postgres Performance
      • Postgres Data Transfer & Preservation
      • Postgres Availability
      • Postgres Special Topics
    • Heroku Data For Redis
    • Apache Kafka on Heroku
    • Other Data Stores
  • Monitoring & Metrics
    • Logging
  • App Performance
  • Add-ons
    • All Add-ons
  • Collaboration
  • Security
    • App Security
    • Identities & Authentication
    • Compliance
  • Heroku Enterprise
    • Private Spaces
      • Infrastructure Networking
    • Enterprise Accounts
    • Enterprise Teams
    • Heroku Connect (Salesforce sync)
      • Heroku Connect Administration
      • Heroku Connect Reference
      • Heroku Connect Troubleshooting
    • Single Sign-on (SSO)
  • Patterns & Best Practices
  • Extending Heroku
    • Platform API
    • App Webhooks
    • Heroku Labs
    • Building Add-ons
      • Add-on Development Tasks
      • Add-on APIs
      • Add-on Guidelines & Requirements
    • Building CLI Plugins
    • Developing Buildpacks
    • Dev Center
  • Accounts & Billing
  • Troubleshooting & Support
  • Integrating with Salesforce
  • Troubleshooting & Support
  • Wrong Version of Ruby or Rake in App

Wrong Version of Ruby or Rake in App

English — 日本語に切り替える

Last updated November 15, 2017

Table of Contents

  • Bad binstubs
  • Bad PATH

When trying to run a command on your app such as

$ heroku run bash
~$ rails c

You may get an error such as:

Could not find rake-12.0.0 in any of the sources
Run bundle install to install missing gems.

This does not mean that your specifed version of the gem is not installed on the dyno—it usually points to a path or configuration problem.

Bad binstubs

In recent versions of Rails the commands are in the form of “binstubs” these are files in the bin directory of your app. So when you run bin/rails c you should be able to start a console. There may be a problem with the code in your binstubs, you can update it by running this command locally:

$ bundle exec rake rails:update:bin

Then commit the results. Depending on your version of rails and the installed gems you should get a directory that looks something like this:

$ ls bin
bundle  puma    pumactl rails   rake    setup   spring  update

Make sure that bundle, rails, and rake are all present. This is an example of what a bin/rails file looks like in Rails 5.0.1

$ cat bin/rails
#!/usr/bin/env ruby
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'

Bad PATH

In UNIX like systems the PATH is how your operating system finds the correct file to execute. When you type a command like rake it searches each location on the PATH to see if it has an executable file by that name and then executes it. You can see where the file lives by executing which <command> such as which rake.

We highly recommend you do not modify your PATH environment variable, this should be maintained for you by our buildpack and build system

Check that you do not have a path config var set, it is not needed and can be actively harmful to the sytem:

$ heroku config
# ...

If you see PATH or GEM_PATH please remove them with heroku config:unset PATH GEM_PATH.

Keep reading

  • Troubleshooting & Support

Feedback

Log in to submit feedback.

Information & Support

  • Getting Started
  • Documentation
  • Changelog
  • Compliance Center
  • Training & Education
  • Blog
  • Podcasts
  • Support Channels
  • Status

Language Reference

  • Node.js
  • Ruby
  • Java
  • PHP
  • Python
  • Go
  • Scala
  • Clojure

Other Resources

  • Careers
  • Elements
  • Products
  • Pricing

Subscribe to our monthly newsletter

Your email address:

  • RSS
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku Blog
    • Heroku News Blog
    • Heroku Engineering Blog
  • Heroku Podcasts
  • Twitter
    • Dev Center Articles
    • Dev Center Changelog
    • Heroku
    • Heroku Status
  • Facebook
  • Instagram
  • Github
  • LinkedIn
  • YouTube
Heroku is acompany

 © Salesforce.com

  • heroku.com
  • Terms of Service
  • Privacy
  • Cookies
  • Cookie Preferences