heroku create -stack cedar : ! Stack not found
Assuming that's not a typo, you need to use --stack
not -stack
:
$ heroku create --stack cedar
GC.stat is undefined on Heroku's Cedar stack
Answer graciously stolen from JD at Heroku:
Cedar uses 1.9.2-p290 by default. I'm not sure if GC.stat is in 1.9.2
offhand, but it appears to not be on Heroku for sure. We don't patch
the Ruby versions we run.I can confirm that if you specify
ruby '1.9.3'
in your Gemfile,GC.stat
will work fine.
Heroku Rails project location
In Ruby you can always do Dir.pwd
to find out what context you are in. You could do this from within the context of your app with heroku run console
to get a remote console on your local machine.
In addition, you can SSH directly into the server by running heroku run bash
. I think you will find your app is stored off the root directory in /app
.
Hope this helps.
Cannot install Heroku on Win7, getting error /bin/env: ruby: No such file or directory
Here is what you could do
- Download heroku toolbet
- Download TortoiseGit
- Setup SSH keys, you can use putty agent
- Git Clone the new heroku app you made using tortoisegit
- Make changes on your folder
- Commit your changes
- Push the changes
- Test the app via adding it on a facebook page
Its not as easy as it looks but it has to be done this way unless you have an https server.
There are documentations there that could help you out.
Good luck :)
Heroku Rails system command fails
I think heroku's filesystem is read-only, so you can't really save files using wget, except if you want to save them inside the '/tmp' folder, where they could be deleted anytime. Moreover, dynos have a 30 seconds timeout, so this would fail for every download which takes more than that interval.
System command with Rails on Heroku
So you'll need to use a custom buildpack to achieve this which will grab wget, compile it and then include the resultant binary into your slug (a heroku term).
Turns out, I've just whipped one up - https://github.com/johnbeynon/heroku-buildpack-wget.
To use;
create a .buildpacks
file in the root of your project containing
git://github.com/heroku/heroku-buildpack-ruby.git
git://github.com/johnbeynon/heroku-buildpack-wget.git
and then do
heroku config:add BUILDPACK_URL=git://github.com/ddollar/heroku-buildpack-multi.git
Now, when you deploy your application, it will use the heroku-buildpack-multi which will read your .buildpacks file and use those defined in there. heroku-buildpack-ruby is the default provided ruby buildpack and then mine will add wget into your application.
to verify if it's work, do heroku run bash
and then try and run wget
and see if it works.
Heroku: running pg_restore from a local file returns errors
You need to use a locally-installed pg_restore
to restore your data into the Heroku-hosted database.
I usually run something like this:
pg_restore --verbose --clean --no-acl --no-owner -h [host address] -p [port] -U [username] -d [name] [file path]
More info here:
PostgreSQL Backup and Restore Commands
Related Topics
Count Number of Days Between Two Dates
Change the Context/Binding Inside a Block in Ruby
Rails 4 How to Ignore Pending Migrations
Get Class Location from Class Object
How to Catch Errno::Econnreset Class in "Case When"
Kernel#Gets Attempts to Read File Instead of Standard Input
Printing Qr Codes Through an Esc/Pos Thermal Printer
Do Fixtures Trigger Model Callbacks
Rspec: How to Test If a Method Was Called
Rails. How to Store Time of Day (For Schedule)
Finding the Session Id in Rails 3
Extracting the Last N Characters from a Ruby String
Put Haml Tags Inside Link_To Helper
Ruby/Sinatra - Serving Up CSS, JavaScript, or Image Files