I am trying to use ruby 1.8.7 in my heroku application but the application does not launch. Heroku shows following errors in the console:
2012-10-30T13:29:08+00:00 app[web.2]: bash: bundle: command not found
heroku run "bundle --version" also returns in command not found:
heroku run "bundle --version"
Running `bundle --version` attached to terminal... up, run.1
bash: bundle: command not found
Any ideas on what might be issue here ?
The code will look like this with the newest version:
heroku config:add GEM_PATH=vendor/bundle/1.8
Have you installed a new ruby version? Good chance that ruby version doesnt have bundler installed, use
heroku run 'gem install bundler'
after installing a new ruby!
You need to have the supported Ruby buildpack set:
heroku buildpacks:set heroku/ruby
Related
I have been deploying a Rails 3.2 application to heroku for several weeks now. I have also been executing rake tasks on the Cedar stack where my application is located.
One day after a deploy I noticed that rake was no longer working. I get, for example, the following:
$:~/dev/my_project$ heroku run rake -T
Running `rake -T` attached to terminal... up, run.7566
bundler: command not found: rake
Install missing gem executables with `bundle install`
Trying to run commands with bundle exec yields the same results.
What I've tried:
heroku run bundle install. This works and informs me that gems were installed into ./vendor/bundle. However, heroku run ls ./vendor/bundle yields only the following:
$:~/dev/my_project$ heroku run ls ./vendor/bundle/
Runningls ./vendor/bundle/attached to terminal... up, run.3458
bin ruby
bundle package. Although the deployment works it does not help my problem.
fiddling around with the rubygems-bundler gem (although I think this is now part of core bundler). This does not seem to have any effect.
On Heroku, gems are installed within the vendor/bundle/ruby/<version>/gems directory. I just checked my Heroku instance and confirmed this.
You are going to want to use bundle exec rake task because the gems are not in the users PATH.
My heroku deployment is crashing with following errors.
2012-12-12T17:16:18+00:00 app[web.1]: bash: bundle: command not found
2012-12-12T17:16:19+00:00 heroku[web.1]: Process exited with status 127
2012-12-12T17:16:19+00:00 heroku[web.1]: State changed from starting to crashed
The Heroku documentation for this error is to set PATH and GEM variables as described in https://devcenter.heroku.com/articles/changing-ruby-version-breaks-path I tried that, however that too is not helping.
→ heroku config:add PATH=bin:vendor/bundle/ruby/1.9.1/bin:/usr/local/bin:/usr/bin:/bin
→ heroku config:add GEM_PATH=vendor/bundle/ruby/1.9.1
→ heroku run rake db:migrate
Running rake db:migrate attached to terminal... up, run.7130
bash: bundle: command not found
Next, I tried setting Ruby version in my Heroku app. This increased the slugsize. But app was still not up.
Gemfile
ruby "1.9.2"
Pushed to Heroku
-----> Using Ruby version: ruby-1.9.2
-----> Installing dependencies using Bundler version 1.2.2
heroku run "ruby -v"
Running `ruby -v` attached to terminal... up, run.4483
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-linux]
Can someone please advice
The error is because your path is incorrect.
If you're trying to use Ruby 1.9.3 you don't need to do anything,
it's the default Ruby so you can remove those config vars.
If you're using
1.8.7 or 1.9.2, then upgrade to 1.9.3 as it's current.
If you're looking at using Ruby 2.0.0.p3 - you're on your own ;)
Heroku is so good at making things simple...but this...not so much. How do you switch from the heroku gem to the new tool belt? Here are the steps I have taken:
$ heroku version: heroku-gem/2.32.5 (x86_64-darwin11.4.1) ruby/1.9.3 autoupdate
removed 'gem "heroku"' from gem file
added 'gem "heroku-api"' to gemfile
deleted gemfile.lock
$ bundle install
installed toolbelt via the package installer
$ heroku login ... returns "Authentication successful"
$ heroku version: STILL RETURNS heroku-gem/2.32.5 (x86_64-darwin11.4.1) ruby/1.9.3 autoupdate
Two questions:
#1 Why is my version still using the heroku-gem after taking the steps above?
#2 Where do I put "heroku = Heroku::API.new(:api_key => API_KEY)" for use with the heroku-api gem?
Deleting the gemfile.lock file didn't cut it. I had to run gem uninstall heroku (which I had 9 version of)... After that, heroku version showed to tool belt.
I get an "Could not find RubyGem heroku (Gem::LoadError)" when I try to execute any Heroku commands from terminal in my app directory. Have tried wiping and reinstalling Toolbelt, as well as any previously installed Heroku gems.
Using the full path works and--app name works (/usr/bin/heroku config--app myapp-stage). Using OS X 10.8.1.
echo $PATH
/Users/johndoe/.rvm/gems/ruby-1.9.3-p194#llctlc/bin:/Users/johndoe/.rvm/gems/ruby-1.9.3 p194#global/bin:/Users/johndoe/.rvm/rubies/ruby-1.9.3-p194/bin:/Users/johndoe/.rvm/bin:/Users/johndoe/.gem/ruby/1.8/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin:/usr/bin/heroku:/opt/local/sbin:/opt/local/bin:/usr/local/mysql/bin:/Users/johndoe/.ec2/bin:/usr/local/git/bin
$ heroku
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:777:in `report_activate_error': Could not find RubyGem heroku (>= 0) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:211:in `activate'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems.rb:1056:in `gem'
from /Users/johndoe/.gem/ruby/1.8/bin/heroku:18
Thanks in advance for any help or advice.
I had the same problem.
Uninstall the Gem gem uninstall heroku (Select 'All Versions').
Find your Ruby 'bin' path by running gem env (it's under 'EXECUTABLE DIRECTORY:')
cd to the bin folder.
Remove the Heroku executable rm heroku
Restart your shell (close Terminal tab and re-open)
Hit heroku version, you should now see something like:
heroku-toolbelt/2.33.1 (x86_64-darwin10.8.0) ruby/1.9.3
Now you can heroku login as per their instructions and get back to hacking :)
I am learning ruby from this guide http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:deploying, and I am trying to install and make heroku to work. I added heroku to the PATH variable, (I am using ubuntu) bun when i type #command: herokuit returns this:
"/usr/lib/ruby/1.8/rubygems.rb:779:in 'report_activate_error': Could not find RubyGem heroku (>=0) (Gem::LoadError)
from /usr/lib/ruby/1.8/rubygems.rb:214:in 'activate'
...
...
..."
Looks like you haven't installed the Heroku gem;
sudo gem install heroku