Ruby on rails Can';我不能让我的RubyonRails项目创建数据库

Ruby on rails Can';我不能让我的RubyonRails项目创建数据库,ruby-on-rails,windows,gem,64-bit,rake,Ruby On Rails,Windows,Gem,64 Bit,Rake,这可能是一个新手设置问题。但这是 机器设置 我有一台运行rails 4.0.0和ruby 2.0.0的Windows 7 64位计算机 我有以下几条路要走 C:\Ruby200-x64\bin;C:\RubyDevKit\bin;C:\RubyDevKit\mingw\bin; 项目设置 我正在从同事的工作存储库中克隆git项目 当我运行我的初始 rake db:migrate 我得到以下错误 rake aborted! Specified 'sqlite3' for database ad

这可能是一个新手设置问题。但这是

机器设置

我有一台运行rails 4.0.0和ruby 2.0.0的Windows 7 64位计算机 我有以下几条路要走

C:\Ruby200-x64\bin;C:\RubyDevKit\bin;C:\RubyDevKit\mingw\bin;
项目设置

我正在从同事的工作存储库中克隆git项目

当我运行我的初始

rake db:migrate
我得到以下错误

rake aborted!
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 's
qlite3'` to your Gemfile.
C:/Working/mynewproject/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
完整的文件是

source 'https://rubygems.org'

ruby '2.0.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
gem 'rails_12factor', group: :production

# Use sqlite3 as the database for Active Record
gem 'sqlite3' 

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Twitter Bootstrap for styling
gem 'bootstrap-sass'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

gem 'protected_attributes' # should probably use strong parameters!
当我运行
bundle install
时,我得到以下列表-请注意缺少sqlite3

Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.7.9)
Using atomic (1.1.13)
Using thread_safe (0.1.2)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using sass (3.2.10)
Using bootstrap-sass (2.3.2.2)
Using coffee-script-source (1.6.3)
Using execjs (2.0.1)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using hike (1.2.3)
Using jbuilder (1.5.1)
Using jquery-rails (3.0.4)
Using json (1.8.0)
Using protected_attributes (1.0.3)
Using bundler (1.3.5)
Using tilt (1.4.1)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using rails_serve_static_assets (0.0.1)
Using rails_stdout_logging (0.0.2)
Using rails_12factor (0.0.2)
Using rdoc (3.12.2)
Using sass-rails (4.0.0)
Using sdoc (0.3.20)
Using turbolinks (1.3.0)
Using uglifier (2.2.1)
Your bundle is complete!
当我执行
捆绑显示'sqlite3'
时,我得到

Could not find gem 'sqlite3'.
Did you mean sqlite3?
Successfully installed sqlite3-1.3.8-x64-mingw32
Parsing documentation for sqlite3-1.3.8-x64-mingw32
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/2.0/sqlite3_native.so, skipping
1 gem installed
当我执行
gem安装'sqlite3'
时,我得到

Could not find gem 'sqlite3'.
Did you mean sqlite3?
Successfully installed sqlite3-1.3.8-x64-mingw32
Parsing documentation for sqlite3-1.3.8-x64-mingw32
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/sqlite3/2.0/sqlite3_native.so, skipping
1 gem installed
在搜索了“无法转换”错误后,我发现我可以在没有文档的情况下安装。所以,如果我这样做了

gem install 'sqlite3' --no-doc 
我明白了

然后当我这么做的时候

rake db:migrate
我还是会

rake aborted!
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 's
qlite3'` to your Gemfile.
C:/Working/mynewproject/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
作为的评论的结果,我删除了Gemfile.lock并运行了
bundle安装
。结果基本相同:

Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.1.0)
Using i18n (0.6.5)
Using minitest (4.7.5)
Using multi_json (1.7.9)
Using atomic (1.1.13)
Using thread_safe (0.1.2)
Using tzinfo (0.3.37)
Using activesupport (4.0.0)
Using builder (3.1.4)
Using erubis (2.7.0)
Using rack (1.5.2)
Using rack-test (0.6.2)
Using actionpack (4.0.0)
Using mime-types (1.25)
Using polyglot (0.3.3)
Using treetop (1.4.15)
Using mail (2.5.4)
Using actionmailer (4.0.0)
Using activemodel (4.0.0)
Using activerecord-deprecated_finders (1.0.3)
Using arel (4.0.0)
Using activerecord (4.0.0)
Using sass (3.2.10)
Using bootstrap-sass (2.3.2.2)
Using bundler (1.3.5)
Using coffee-script-source (1.6.3)
Using execjs (2.0.1)
Using coffee-script (2.2.0)
Using thor (0.18.1)
Using railties (4.0.0)
Using coffee-rails (4.0.0)
Using hike (1.2.3)
Using jbuilder (1.5.1)
Using jquery-rails (3.0.4)
Using json (1.8.0)
Using protected_attributes (1.0.3)
Using tilt (1.4.1)
Using sprockets (2.10.0)
Using sprockets-rails (2.0.0)
Using rails (4.0.0)
Using rails_serve_static_assets (0.0.1)
Using rails_stdout_logging (0.0.2)
Using rails_12factor (0.0.2)
Using rdoc (3.12.2)
Using sass-rails (4.0.0)
Using sdoc (0.3.20)
Using turbolinks (1.3.0)
Using uglifier (2.2.1)
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
所以仍然没有提到sqlite3和rake db:migrate仍然导致

rake aborted!
Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 's
qlite3'` to your Gemfile.
C:/Working/its-a-disaster/config/environment.rb:5:in `<top (required)>'
Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)
和rails——版本说

Rails 4.0.0

问:同一台机器上是否有其他ruby安装

有三个-1.9.2、1.9.3和2.0.0 后者是道路上的一个。
另外两个我已经移除了

Bundler和64位Ruby存在一个已知问题,它没有检测到捆绑包中的
x64-mingw32
gem平台,因此导致它失败

我相信这在1.4.0预发布版本中已经得到了修复,您可以通过以下方式尝试:

gem update bundler --pre

bundle install
64位版本可能会遇到其他问题。以下是我个人的建议:

除非您真的被迫工作或创建使用超过2GB RAM的应用程序(很可能不是Rails应用程序),否则我建议您使用32位版本的Ruby(以及相应的DevKit)

虽然您有64位版本的Windows,但该系统完全能够运行32位应用程序而不会出现问题。在使用Rails开发Web应用程序时,不会出现明显的性能下降

虽然Ruby 2.0.0已被标记为稳定且可用于生产,但并非所有的gems和相关工具都已更新以正常使用它。正如您在Bundler和64位Ruby的案例中所看到的,仍然有一些粗糙的边缘需要消除。与大多数开源软件一样,这是一项社区工作,可能需要帮助


希望这有帮助。

发布您的gem文件,指定的sqlite3 gem在哪里?它是否在开发组中?在其中指定包后是否再次运行包安装?只需将它包括在您的包中,如gem'sqlite3'并运行bundle安装again@Doon-更新以在中添加文件question@techvineet是的,好几次都没有在同一台机器上安装其他ruby?谢谢Luis。这个命令起了作用,使我不用手动将-x86-mingw32替换为-x64-mingw32。很高兴听到@Jane,但请记住其他建议。您可能会遇到一些gem的其他问题,这些gem在32位版本中工作得不太好。
Rails 4.0.0
gem update bundler --pre

bundle install