在 OSX 10.5.8 上设置 Rails/sqlite3

发布于 2025-01-06 18:02:27 字数 1260 浏览 0 评论 0原文

我正在尝试开始学习 Rails 教程并完成安装。我是新手。

1.运行“rails new app1”。 - 应用程序已创建,但捆绑程序失败(看起来它是作为 rails new 命令的一部分运行的

安装 sqlite3 (1.3.5) 时发生错误,

  1. 更改了 gemfile 以显式调用 “gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'(这是适用于 osx 10.5 的最新版本)”
  2. 运行“bundle install” - 成功
  3. 尝试查看默认应用程序并查看错误

    <块引用>

    ActiveRecord::ConnectionNotEstablished

  4. 在 config/database.yml 中查找。它说“database: db/development.sqlite3

  5. 在 db/ 中查找 - 这里没有数据库。 - - 数据库应该在rails new期间创建吗?
  6. 尝试运行rake db:migrate - get <块引用>

    “耙子中止! :请安装 sqlite3 适配器:gem install activerecord-sqlite3-adapter (sqlite3 不是捆绑包的一部分。将其添加到 Gemfile。)"

Tried running that command, got

ERROR:  Could not find a valid gem 'activerecord-sqlite3-adapter' (>= 0) in any repository
ERROR:  Possible alternatives: activerecord-jdbcsqlite3-adapter, activerecord-sqlserver-adapter, activerecord-spatialite-adapter, activerecord-n
ulldb-adapter, activerecord-dbslayer-adapter

有人知道我错过了什么吗?

有人知道我需要做什么吗? OSX 10.5.8(豹) 导轨3.2.0 红宝石 1.9.2

I'm trying to get get going on a rails tutorial and get get past the installation. I'm a newbie.

1 . ran "rails new app1." - The app is created but bundler fails (looks like it is run as part of the rails new command

An error occured while installing sqlite3 (1.3.5),

  1. changed the gemfile to explicitly call for "gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3' (this is the most recent version that works on osx 10.5)"
  2. ran "bundle install" - success
  3. try to view the default app and see the error

    ActiveRecord::ConnectionNotEstablished

  4. looked in config/database.yml. It says "database: db/development.sqlite3"

  5. looked in db/ - no database here. - - Is a db supposed to be created during rails new?
  6. Tried running rake db:migrate - get

    "rake aborted!
    : Please install the sqlite3 adapter: gem install activerecord-sqlite3-adapter (sqlite3 is not part of the bundle. Add it to Gemfile.)"

Tried running that command, got

ERROR:  Could not find a valid gem 'activerecord-sqlite3-adapter' (>= 0) in any repository
ERROR:  Possible alternatives: activerecord-jdbcsqlite3-adapter, activerecord-sqlserver-adapter, activerecord-spatialite-adapter, activerecord-n
ulldb-adapter, activerecord-dbslayer-adapter

Anyone know what I'm missing?

Anybody have an idea what I need to do?
OSX 10.5.8 (leopard)
rails 3.2.0
ruby 1.9.2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

驱逐舰岛风号 2025-01-13 18:02:27

好吧,最后一部分听起来有点毛茸茸的,但是要对数据库进行排序,您需要:

rake db:setup

...不是迁移,而是创建数据库。

rake -T | grep db

...向您显示选项,以供将来参考。让我们看看之后会发生什么:)

Well that last part is a bit hairy sounding, but to get your database sorted you want:

rake db:setup

...not migration, to create the database.

rake -T | grep db

...shows you the options, for future reference. Let's see what happens after that :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文