Heroku gem not working with RVM
I experienced the same problem, and I think it was caused by not installing all the ruby dependencies listed when you run:
$rvm requirements # it was earlier: rvm notes
Specifically, I executed [be sure to install aptitude first]:
$sudo aptitude install build-essential bison openssl libreadline5 libreadline5-dev curl git zlib1g zlib1g-dev libssl-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev
and after all that, I recompiled my ruby install (using $rvm reinstall 1.9.2
) and heroku worked like a charm.
Updating Heroku gem, on RVM (OSX), has resulted in a LoadError and broken heroku gem. What is safest way to fix?
Gem netrc
is dependency of heroku
, run gem install heroku
again to install all dependencies.
Heroku Toolbelt install problems
make sure heroku
is not part of your Gemfile
- it should not be there.
then remove ./bundler_stubs/heroku
:
rm -f ./bundler_stubs/heroku
it is possible that ./bundler_stubs/heroku
is part of your project and was committed by one of your coworkers, the stubs should not be part of the project.
can't install puma gem, using with Heroku and rails
As mentioned in my comment, gems that are part of the production group won't run in development (unless you purposely run a production environment locally)
If you truly want to run Puma in development (which I recommend), remove it from the production group in your Gemfile
and run bundle install
again.
so this:
group :production do
gem 'puma'
end
becomes just:
gem 'puma'
Heroku Deploy Failed | gem install json -v '1.8.1'
It is reverting to Ruby 2.4.4 because that is the current default version used by Heroku. This suggests that Ruby 2.3.0 is no longer supported. Check out Heroku's ruby version support page for more information.
Revert back to the Ruby version you were using and run
$ bundle update && bundle install
Then try pushing to heroku
Can't make calls to heroku CLI from within a Rake task without the Heroku gem in the Gemfile
The gem's version of the heroku
command probably has a higher priority in your PATH than the system's.
I was able to reproduce this in a test project.
When I run which heroku
, I see that the shell's choice is /home/justinf/.rvm/gems/ruby-1.9.3-p286/bin/heroku
.
All it takes is a simple gem uninstall heroku
, answering yes to deleting the executable.
which heroku
now gives me /usr/bin/heroku
, and my test.rb now completes with no error instead of crashing out with a bundler exception.
Problems with heroku toolbelt
The problem is that the heroku
executable you installed probably starts with a line like this:
#!/usr/bin/ruby
This will force the heroku
command to always use the system-wide ruby (/usr/bin/ruby
) and it will never run your rvm version of ruby.
To fix it simply edit the first line of the heroku
script to this:
#!/usr/bin/env ruby
This will make the heroku
command run whichever ruby command is in the current PATH
, instead of a hard coded path like previously.
To find the location of the heroku
script, so you can edit it, simply type:
which heroku
It should print out the location of the script so you can find it and load it into your editor.
Related Topics
Rails - How to Check Developer Mode or Production Mode in Code
What Is the Easiest Way I Can Create a 'Beep' Sound from a Ruby Program
Convert Datetime String to Utc in Rails
How to Log the Entire Trace Back of a Ruby Exception Using the Default Rails Logger
Rails 5.2 Active Storage Add Custom Attributes
How to Access a Ruby Module Method
Better Way to Turn a Ruby Class into a Module Than Using Refinements
Differencebetween Methods and Attributes in Ruby
Redirect the "Puts" Command Output to a Log File
Rails: Ensure Only One Boolean Field Is Set to True at a Time
Resque Multiple Workers in Development Mode
Ruby: How to Chain Multiple Method Calls Together with "Send"
Installing Ruby 2.0.0 Using Rvm
Regex with Named Capture Groups Getting All Matches in Ruby
Rubymine: Rails Server Launcher Wasn't Found in the Project
How to Return Multiple Tags from a Rails Helper