What version of Rake does Heroku Cedar use?
My gemfile is at version 10.0.2 which the deployment code confirms is bundling on Heroku:
Installing rake (10.0.2)
But the app won't start, and running heroku run rake db:migrate --app appname or looking at the heroku logs --tail gives me /app/vendor/bundle/ruby/1.9.1/gems/rake-10.0.2/lib/rake.rb:24:in 'require': no such file to load -- rake/version (LoadError)
rake is not pre-installed on Cedar, you just have an empty container. All the dependencies are brought in from your application (e.g Bundler).
Related
I have a ruby/rails program. I'm trying to do a rake db:migrate, when I'm on my own machine, it works fine. When I'm using my heroku instance, and run: heroku run rake db:migrate --app APPNAME it gives:
/app/vendor/ruby-2.5.3/lib/ruby/2.5.0/rubygems/resolver.rb:231:in `search_for': Unable to resolve dependency: user requested 'fileutils (= 1.0.2)' (Gem::UnsatisfiableDependencyError)
I've made sure that fileutils is in my Gemfile, and I've manually run: heroku run gem install fileutils -v 1.0.2 --app APPNAME but that doesn't seem to help any.
What am I missing?
I am trying to deploy my rails app to Heroku. I've created an app and successfully pushed it, but when i do
heroku run rake db:migrate
i am getting this error
> rake aborted!
> LoadError: libruby.so.2.3: cannot open shared object file: No such file or directory -
> /app/vendor/bundle/ruby/2.3.0/gems/pg-0.21.0/lib/pg_ext.so
Rails 5.0.4
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
pg-0.21.0
I've seen similar posts and tried to apply described solutions, but no luck. Tried other versions of pg like here Cannot migrate on Heroku
But it didn't help.
Thanks.
Try purging Heroku dyno's cache:
heroku plugins:install https://github.com/heroku/heroku-repo.git
heroku repo:purge_cache -a appname
How can I clear the cache on Heroku?
I've tried heroku run rails c + Rails.cache.clear and receive the following error
Errno::ENOENT: No such file or directory # dir_initialize - /app/tmp/cache/
I also tried heroku run rake tmp:clear (from this post). The task runs but when I go back into the console and run Rails.cache, nothing has changed.
How can I clear the cache?
Did you try this? (This works with Celadon Cedar with the Heroku Toolbelt package at least)
heroku run --app YOUR_APP_NAME rails runner Rails.cache.clear
Update
If the above does not work, try running:
heroku run rake tmp:create
heroku run rake tmp:clear
I'm running a Rails application using the Rika gem (JRuby wrapper for Apache Tika). It runs fine locally. In trying to push it to Heroku, it gets a ways into the deployment until I hit the asset precompile:
...
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
Running: rake assets:precompile
rake aborted!
No such file to load -- rika
followed by a long string of /tmp/build_8a51... errors.
Precompile works fine on the local machine.
If I try to install the gem via 'heroku run' I get:
$ heroku run gem install rika
Running gem install rika attached to terminal... up, run.8601
ERROR: While executing gem ... (ArgumentError) malformed format string - %)
Any suggestions?
Thanks
Found the problem.
I needed to add the ruby version spec line to the Gemfile. It wasn't necessary on the local machine because I set the version externally. Heroku needs it though.
Folks, I am following Ruby on Rails Tutorial and working on the DemoApp in Chapter 2. My env is :
Win 7
Ruby 1.9.3
Rails 4.0.2
I have deployed the demo app (under directory demo_app) locally and have tested it out locally as well. I did push it to Heroku using
c:\rails_projects\demo_app heroku create --stack cedar
c:\rails_projects\demo_app git push heroku master
the app gets deployed to heroku.
When I run: heroku run rake db:migrate
I get the error:
No app specified. Run this command from an app folder or specify which app to use with --app APP.
I have run it with heroku run rake db:migrate --app demo_app
but get the same error.
Not sure what to do.
Heroku will have given your app a random name when you created the app. Run heroku apps from the terminal to get the name of your app, then heroku run rake db:migrate --app your_app_name.
Assuming the name of your app is robot.
On your terminal, heroku run rake db:migrate --app=robot