【问题标题】:How to resolve load error in ROR-4如何解决 ROR-4 中的加载错误
【发布时间】:2014-12-19 15:15:32
【问题描述】:

请任何可以帮助我解决此错误的方法。输入 gem install mysql 后,我输入了 bundle install。 当我输入命令 rake db:create/bundle exec rake db:create 它给出了以下错误。

错误:

LoadError: cannot load such file -- mysql/mysql_api
c:/Site/book/config/application.rb:7:in `<top (required)>'
c:/Site/book/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

config/application.rb

require File.expand_path('../boot', __FILE__)

require 'rails/all'

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Sqldb
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de
  end
end

我的 rakefile 包含以下代码。

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)

Rails.application.load_tasks

请帮我解决这个错误。

【问题讨论】:

标签: mysql ruby-on-rails ruby


【解决方案1】:

您是否尝试从 32 位 Ruby 安装访问 64 位 MySQL 安装。这似乎是很多人的问题,即使我有一个新的Win7(64位)新机器时也遇到过。

尝试此博客上提供的解决方案:-

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-15
    • 1970-01-01
    • 2013-11-11
    • 2020-06-18
    相关资源
    最近更新 更多