- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我刚刚在这台机器上第一次安装了 rbenv、ruby 2.2.3 和 rails 4.2.4。我启动了我的 Rails 应用程序,没有更改任何代码,只是使用 rails new .
生成的默认文档,然后我使用 rails server
启动了服务器。
当点击 http://localhost:3000
时,出现以下错误:
“为数据库适配器指定了‘postgresql’,但未加载 gem。将 gem 'pg'
添加到您的 Gemfile(并确保其版本为 ActiveRecord 要求的最低版本)。”
我已经从以前的 Node 项目中安装了 postgres,但是我的 database.yml 仍然像您对新应用程序的期望那样读取:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: sqlite3
pool: 5
timeout: 5000
development:
<<: *default
database: db/development.sqlite3
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
<<: *default
database: db/test.sqlite3
production:
<<: *default
database: db/production.sqlite3
我现在真的不想使用 Postgres,我才刚刚开始,我宁愿使用 SQLite3 让事情简单一些。有谁知道可能发生了什么以及我可以做些什么来使用 SQLite3 来获取它以便停止此错误?
最佳答案
还有另一种解决方案,适用于那些实际需要保留 DATABASE_URL
环境变量而不影响 Rails 的人(比如我)。您可以使用 url
子键:
development:
<<: *default
url: sqlite3:db/development.sqlite3
这已记录在案 here .
关于ruby-on-rails - Fresh Rails 应用程序默认使用 Postgres 而不是 SQLite3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32287768/
我对以下代码示例有疑问(取自:http://www.albahari.com/threading/part4.aspx#_NonBlockingSynch) class Foo { int _a
我在 FragmentStateAdapter 中有一个包含多个 fragment 的 viewpager2。每当我尝试打开一个新 fragment 然后使用 viewpager2 返回到当前 fra
我使用Yii- boilerplate(Haml分支)生成了一个新项目,但是出现错误: Use of undefined constant HAMLPHP_ROOT - assumed 'HAMLPH
JLS 中的“新类型变量”是什么意思 Conversions and Promotions章节? 最佳答案 新鲜 是以前不得使用过的变量的通用名称。 关于Java "fresh type variab
我只想在应用程序生命周期中显示一次启动画面。这是我的代码: SplashScreenActivity.java: final int welcomeScreenDisplay = 3000; Thre
将 Android Studio 更新至 3.1,并创建新的 Kotlin 项目并将新的 Kotlin 模块添加到主应用程序。现在尝试构建项目,它在配置构建时失败,并显示“配置项目':应用程序'时出现
我正在尝试使用flutter create app_name来测试Flutter,并使用Android Studio和VS Code来获取runApp上的错误,但未定义,实际上在flutter库中我看
已结束。此问题正在寻求书籍、工具、软件库等的推荐。它不满足Stack Overflow guidelines 。目前不接受答案。 我们不允许提出寻求书籍、工具、软件库等推荐的问题。您可以编辑问题,以便
好的,所以我有以下问题: 我有以下内容:x.py: from y import aFunc y.py: from z import aDict 现在,x 按照运行、 sleep 、重复的时间表运行。然
我喜欢 Fresh Paint 色环的外观,并想将其克隆到我的传入项目中。但是,我找不到圆的 HSV 或 RGB 分布模式。这是一个例子: 我猜右边的 slider 是从 0 到 360 的 H 值。
我最近在玩新的 deno 框架,一切都很棒,但在某个时候,我意识到不可能将任何额外的元数据添加到页面标题标签。基本上我想做两件事: 添加标题标签 从我的静态目录 链接一些 css 文件 您知道如何实现
我在使用 DownloadManager 时遇到了一个非常奇怪的问题。 我将一些 .zip 文件下载到/mnt/sdcard/Download。 BroadcastReceiver.onReceive
在遵循安装说明(例如,对于 os x 的 caffe)时,我遇到了 homebrew 的 --fresh 标志。 .例如, brew install --fresh -vd snappy leveld
全新安装 JFrog Artifactory 服务器后,我无法启动应用程序。我正在使用 percona 5.6 mysql db 服务器。 artifactory.service - Setup Sy
我想使用 开发 android 应用程序 react 原生 ,它在模拟器上运行良好,但是当我尝试使用真实设备时,应用程序在启动时会立即关闭,即使它使用 fress react-native init
我是刚开始使用C++开发GUI aps的人,在开始时遇到了一些问题。所以这是故事: 我使用MinGW 4.7.2下载并编译了QT库(v4.8.3),并配置了qtcreator以使用它。 我可以编译并运
我正在使用 JSON 请求来检索我正在开发的网页中的一些流计量信息。为了兼容 IE,我使用 XDomainRequest。 XDR 在页面首次加载期间成功检索数据,但后续调用(加载后我在页面上使用 w
请看下面的代码: private static boolean flag=true; // main thread will call flag=false private final static
我对钛合金应用程序加速器完全陌生,我用谷歌搜索了这个,但只发现了过时的问题。我构建了一个钛合金项目,我安装了xcode并连接了android sdk。 当我尝试在 Android 模拟器上运行时,出现
我在 Splint 文档中搜索了“fresh storage”,发现有提及,但没有正式定义。其他修饰符,如 null 或 only,我理解并正在使用。我只是不确定新鲜存储是什么。 情况是这样的: vo
我是一名优秀的程序员,十分优秀!