Switch from heroku gem to heroku-api topolbelt - heroku

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.

Related

Changing Heroku version from gem to toolbelt

I have downloaded the Heroku toolbelt a few times but whenever I run
heroku version
I am getting
heroku-gem/1.6.3
I have tried to uninstall the heroku gem but I can't seem to use the heroku toolbelt. What's the correct process to use the toolbelt?
Thanks!
it's likely coming from a Gemfile that is including the heroku gem. Remove it from there.
Alternatively you could include the toolbelt higher in the PATH environment variable than your ruby gems.
I was having the same problem, this what I did:
Install the heroku-toolbelt from the webpage.
go to /usr/local/heroku/bin and run ./heroku version this will throw the version of the current bin, problably this is the version you want to use.
run which heroku this will throw you a path, if the path is diferent that /usr/local/heroku/bin then just: rm -rf path
restart your console/terminal run heroku version
if dosn't work probably you need to add /usr/local/heroku/ to your $PATH.
restart and thats all
I was using oh-my-zshell with the heroku plugin which gave me the error and this is how i solve it, hope work for you.
#UPDATE
I restart and suddenly I had the same error again :/ and I fixed by:
gem uninstall heroku and rbenv rehash

referencing a ruby gem from git breaks aws beanstalk deployment

I have set up my aws environment succesfully. However i am having one probelem. In my Gemfile i have the following line:
gem 'activeadmin', :github => 'gregbell/active_admin'
When i do a git aws.push i can see the following error in the aws logs:
/usr/local/share/ruby/gems/2.0/gems/bundler-1.3.5/lib/bundler/source/git.rb:177:in `rescue in load_spec_files': git://github.com/gregbell/active_admin.git (at master) is not checked out. Please run `bundle install` (Bundler::GitError)
I was able to fix that problem by creating this file: .ebextensions/ruby.config
option_settings:
- option_name: BUNDLE_DISABLE_SHARED_GEMS
value: "1"
- option_name: BUNDLE_PATH
value: "vendor/bundle"
packages:
yum:
git: []
This packages everything into vendor/bundle and my app starts correctyl.
However I have two problems with this approach:
It takes very long to deploy because it needs to install all gems every time
I am not longer able to execute commands when I ssh into the EC2 instance. For example I have to start an rpush deamon. Locally this works with bundle exec rpush development but on EC2 this results in:
bundle exec rpush
/usr/local/share/ruby/gems/2.0/gems/bundler-1.3.5/lib/bundler.rb:284: warning: Insecure world writable dir /var/app/current/vendor/bundle/bin in PATH, mode 040777
git://github.com/gregbell/active_admin.git (at master) is not checked out. Please run bundle install
Is there an other way for installing the gems correctly and at the same time using the system gems? Or if that is not possible, how can I start rpush when the gems are bundled?
Update your Gemfile.lock (bundle install&& bundle update) in your local env. and push a commit with Gemfile and Gemfile.lock. Deploy to AWS again.
Can you check if using gem 'activeadmin', 'git://github.com:gregbell/active_admin' in your Gemfile works for you?
You can also get faster deployments utilizing vendor/cache by following the instructions given here:
http://blogs.aws.amazon.com/application-management/post/Tx2XVRWSS4E971S/Locally-Packaging-Gem-Dependencies-for-Ruby-Applications-in-Elastic-Beanstalk
What solved my problem: I modified the bundle install script and added the --deployment flag

bundle command not found heroku

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

Toolbelt install: Could not find gem Heroku

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 :)

heroku running problem

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

Resources