尝试mimemagic 0.3.10在 Ruby on Rails 项目中安装时遇到以下错误。注意,它是在Windows环境下运行的。这是最相关的错误堆栈跟踪:
Fetching mimemagic 0.3.10
Installing mimemagic 0.3.10 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory:
C:/Ruby26/lib/ruby/gems/2.6.0/gems/mimemagic-0.3.10/ext/mimemagic
C:/Ruby26/bin/ruby.exe -rrubygems
C:/Ruby26/lib/ruby/gems/2.6.0/gems/rake-13.0.6/exe/rake
RUBYARCHDIR\=C:/Ruby26/lib/ruby/gems/2.6.0/extensions/x86-mingw32/2.6.0/mimemagic-0.3.10
RUBYLIBDIR\=C:/Ruby26/lib/ruby/gems/2.6.0/extensions/x86-mingw32/2.6.0/mimemagic-0.3.10
rake aborted!
Could not find MIME type database in the following locations:
["/usr/local/share/mime/packages/freedesktop.org.xml",
"/opt/homebrew/share/mime/packages/freedesktop.org.xml",
"/opt/local/share/mime/packages/freedesktop.org.xml",
"/usr/share/mime/packages/freedesktop.org.xml"]
Ensure you have either installed the shared-mime-info package for your
distribution, or
obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to
the location
of that file.
This gem might be installed …Run Code Online (Sandbox Code Playgroud) 尝试使用该flutter run命令运行 Flutter 应用程序会产生以下错误:
No `<meta-data android:name="flutterEmbedding" android:value="2"/>` in "..\src\main\AndroidManifest.xml"
Run Code Online (Sandbox Code Playgroud)
这是我的AndroidManifest.xml文件:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.coding.informer.simple_material_app">
<uses-permission android:name="android.permission.INTERNET"/>
<application android:name="${applicationName}" android:label="simple_material_app" android:icon="@mipmap/ic_launcher">
<activity android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
我知道错误消息提供了一个明显的解决方案,但我想在这里发布我的答案,以便其他遇到此错误的人可以快速解决它。