gpt4 book ai didi

ruby-on-rails - 在 Windows 7 上使用 Ruby on Rails 遇到困难

转载 作者:可可西里 更新时间:2023-11-01 10:04:42 24 4
gpt4 key购买 nike

我挑战自己尝试学习 Ruby on Rails,并开发了一个基本的自举站点。如果有帮助的话,我来自 Java。

我已经学习了多个教程并观看了很多视频,但我很难开始使用 Ruby on Rails。

详细信息:

  • 我没有使用 RVM。
  • 我在 64 位 Windows 7 上使用 Cygwin。
  • 我拥有 Ruby on Rails 所需的所有软件包。
  • 我已经删除(或至少尝试过)Rubygems、Rruby 和 Rails 所在的所有其他位置,因此它们应该都在 Cygwin 中。
  • 当我在 Cygwin 中键入 which ruby​​ 时,我得到 /usr/bin/Ruby
  • 当我输入 which rails 时,我得到 /usr/bin/rails
  • 我不知道如何获取我正在使用的 RubyGems,主要是因为现在 gems 和其他东西对我来说完全陌生,我还没有学习这些教程。

当我执行 rails -vrails server 时,出现此错误:

Could not find gem 'sqlite3-ruby (>= 0) ruby' in any of the gem sources listed in your Gemfile.
Try running `bundle install`.

当我执行 bundle installbundle update 时,我收到一个错误,我似乎找不到任何其他人收到:

Fetching source index for http://rubygems.org/
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:253:in `fetch_all_remote_specs': undefined method `list' for #<Gem::SpecFetcher:0x00000600716118> (NoMethodError)
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:234:in `block in remote_specs'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `remote_specs'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:165:in `fetch_specs'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/source.rb:70:in `specs'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:176:in `block (2 levels) in index'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `each'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `block in index'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/index.rb:7:in `build'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:174:in `index'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:168:in `resolve'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:107:in `specs'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/definition.rb:102:in `resolve_remotely!'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/installer.rb:43:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/installer.rb:8:in `install'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>'
from /usr/bin/bundle:23:in `load'
from /usr/bin/bundle:23:in `<main>'

I'm fine with installing RVM, though when I do, I'm afraid I'll run into incompatibilities because I'm doing this from Cygwin, and I messed this all up two days ago, I finally got it to get this far.

我使用的教程是:

另外,我正在阅读 Rails 如何使用 SQLLite 进行本地数据库测试。这会影响我使用 Mongo 的能力吗?我最近学会了如何使用它,并且已经开始将它用于我正在处理的一个小项目来记录事情。

最佳答案

使用 Cygwin 有什么特别的原因吗?这可能不是您想要的答案,但更简单的方法是使用 Rails Installer如果你真的需要在 Windows 上。另一个免费且有用的选项是下载 Virtual Box ,安装它,然后安装 Linux 的副本。 Linux Mint 是一个非常简单的发行版,或者是旧的备用 Ubnuntu。

关于ruby-on-rails - 在 Windows 7 上使用 Ruby on Rails 遇到困难,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18649131/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com