Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rake error deploying to Heroku with 0.3.10 #161

Open
bjnord opened this issue Apr 24, 2021 · 1 comment
Open

Rake error deploying to Heroku with 0.3.10 #161

bjnord opened this issue Apr 24, 2021 · 1 comment

Comments

@bjnord
Copy link

bjnord commented Apr 24, 2021

We've been using the USE_FREEDESKTOP_PLACEHOLDER=true approach and it's worked fine for our apps that are deployed elsewhere. But today I tried this approach for a Heroku-deployed app, and I get the following error. The bundle exec rake -P command works fine locally, but the dummy.xml file it's apparently looking for in the Heroku build/deploy environment is not there on my local system either.

My app details:

$ egrep "^ruby|^gem .rails| rails |mimemagic" Gemfile* .ruby-version | grep -v ':#'
Gemfile:ruby '2.7.3'
Gemfile:gem 'rails', '~> 5.2.4', '>= 5.2.4.4'
Gemfile:gem 'mimemagic', '~> 0.3.10'
Gemfile.lock:      mimemagic (~> 0.3.2)
Gemfile.lock:    mimemagic (0.3.10)
Gemfile.lock:    rails (5.2.4.4)
Gemfile.lock:  mimemagic (~> 0.3.10)
Gemfile.lock:  rails (~> 5.2.4, >= 5.2.4.4)
.ruby-version:ruby-2.7.3
$ heroku config:get USE_FREEDESKTOP_PLACEHOLDER
true
$ env | grep FREEDESK
USE_FREEDESKTOP_PLACEHOLDER=true
$ ls ~/.rvm/gems/ruby-2.7.3/gems/mimemagic-0.3.10/dummy.xml
ls: cannot access /home/bjn/.rvm/gems/ruby-2.7.3/gems/mimemagic-0.3.10/dummy.xml: No such file or directory
$ bundle exec rake -P | grep db:version
rake db:version
$ bundle -v
Bundler version 1.16.6

The Heroku build/deploy error:

-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.7.3
-----> Installing dependencies using bundler 1.17.3
       Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 BUNDLE_GLOBAL_PATH_APPENDS_RUBY_SCOPE=1 bundle install -j4
       Using rake 13.0.1
[...]
       Using mimemagic 0.3.10
[...]
       Bundle complete! 25 Gemfile dependencies, 62 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into `./vendor/bundle`
       Removing bundler (1.17.3)
       Bundle completed (0.47s)
       Cleaning up the bundler cache.
-----> Installing node-v12.16.2-linux-x64
-----> Detecting rake tasks
 !
 !     Could not detect rake tasks
 !     ensure you can run `$ bundle exec rake -P` against your app
 !     and using the production group of your Gemfile.
 !     rake aborted!
 !     Errno::ENOENT: No such file or directory @ rb_sysopen - /tmp/build_f6907ac1/vendor/bundle/ruby/2.7.0/gems/mimemagic-0.3.10/dummy.xml
@katafrakt
Copy link

Looking at how USE_FREEDESKTOP_PLACEHOLDER is implemented, I don't think you can get it to work on Heroku (or any other platform where build step is separated from run step).

Maybe instead you could try creating an empty file manually (somewhere in your code) and point FREEDESKTOP_MIME_TYPES_PATH env var to it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants