【问题标题】:Error: Could not find activemodel-3.2.13 in any of source错误:在任何源中都找不到 activemodel-3.2.13
【发布时间】:2016-04-26 09:53:34
【问题描述】:

我在启动准备好的项目时遇到问题。 当我启动程序时:

导轨 我得到: 在任何来源中都找不到 activemodel-3.2.13

运行 'bundle install' 来安装缺失的 gems

运行后:

捆绑安装

我有:

安装带有原生扩展的mysql2 0.3.16

Gem::Installer::ExtensionBuildError: ERROR: 未能构建 gem 原生扩展。

e:/Different/RoR/Ruby22/bin/ruby.exe extconf.rb

* extconf.rb 失败 *

由于某种原因无法创建 Makefile,可能缺少必要的 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。

Gem::Installer::ExtensionBuildError: ERROR: 未能构建 gem 原生扩展。

Gem 文件将继续安装在 e:/Different/RoR/Ruby22/lib/ruby/gems/2.2.0/gems/debugger-1.6.8 以供检查。

结果记录到 e:/Different/RoR/Ruby22/lib/ruby/gems/2.2.0/gems/debugger-1.6.8/ext/ruby_debug/gem_make.out

安装 mysql2 (0.3.16) 时出错,Bundler 无法继续。

在捆绑之前确保gem install mysql2 -v '0.3.16' 成功。

这不是所有的日志,只是有错误。

接下来我运行:

gem install mysql2 -v '0.3.16'

我明白了:

错误:安装 mysql2 时出错:

错误:构建 gem 原生扩展失败。

* extconf.rb 失败 *

由于某种原因无法创建 Makefile,可能缺少必要的 库和/或标题。检查 mkmf.log 文件以获取更多详细信息。你可以 需要配置选项。

Gem 文件将继续安装在 E:/Different/RoR/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.16 以供检查。

结果记录到 E:/Different/RoR/Ruby22/lib/ruby/gems/2.2.0/gems/mysql2-0.3.16/ext/mysql2/gem_make.out

那我该怎么办? 早些时候,我还有一个与 SSL 连接错误有关的错误。所以我无法从http://rubygems.org/ 加载。不过现在好像没了。

我的宝石文件:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'rake', '10.2.1'
# gem 'sqlite3'
gem 'mysql2'
gem 'haml-rails'
gem 'annotate', '>=2.6.0'
gem 'bcrypt-ruby', '3.0.1'
gem "date-input-rails"
gem "nested_form"
gem 'debugger'
#gem "thin"

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'bootstrap-sass', '3.0'
  gem 'bootstrap-datepicker-rails'
  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

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

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

我的 GemFile.lock:

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.13)
      actionpack (= 3.2.13)
      mail (~> 2.5.3)
    actionpack (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
    activerecord (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
    activesupport (3.2.13)
      i18n (= 0.6.1)
      multi_json (~> 1.0)
    annotate (2.6.1)
      activerecord (>= 2.3.0)
      rake (>= 0.8.7)
    arel (3.0.3)
    bcrypt-ruby (3.0.1)
    bootstrap-datepicker-rails (1.3.0.1)
      railties (>= 3.0)
    bootstrap-sass (3.0.0.0)
      sass (~> 3.2)
    builder (3.0.4)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.7.0)
    columnize (0.9.0)
    date-input-rails (0.0.3)
      jquery-ui-rails
      rails (~> 3.2.8)
    debugger (1.6.8)
      columnize (>= 0.3.1)
      debugger-linecache (~> 1.2.0)
      debugger-ruby_core_source (~> 1.3.5)
    debugger-linecache (1.2.0)
    debugger-ruby_core_source (1.3.7)
    erubis (2.7.0)
    execjs (2.0.2)
    haml (4.0.5)
      tilt
    haml-rails (0.4)
      actionpack (>= 3.1, < 4.1)
      activesupport (>= 3.1, < 4.1)
      haml (>= 3.1, < 4.1)
      railties (>= 3.1, < 4.1)
    hike (1.2.3)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (3.1.0)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (4.1.2)
      railties (>= 3.1.0)
    json (1.8.1)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.25.1)
    multi_json (1.8.4)
    mysql2 (0.3.16)
    nested_form (0.3.2)
    polyglot (0.3.3)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.13)
      actionmailer (= 3.2.13)
      actionpack (= 3.2.13)
      activerecord (= 3.2.13)
      activeresource (= 3.2.13)
      activesupport (= 3.2.13)
      bundler (~> 1.0)
      railties (= 3.2.13)
    railties (3.2.13)
      actionpack (= 3.2.13)
      activesupport (= 3.2.13)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.2.1)
    rdoc (3.12.2)
      json (~> 1.4)
    sass (3.2.14)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thor (0.18.1)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.38)
    uglifier (2.4.0)
      execjs (>= 0.3.0)
      json (>= 1.8.0)

PLATFORMS
  ruby

DEPENDENCIES
  annotate (>= 2.6.0)
  bcrypt-ruby (= 3.0.1)
  bootstrap-datepicker-rails
  bootstrap-sass (= 3.0)
  coffee-rails (~> 3.2.1)
  date-input-rails
  debugger
  haml-rails
  jquery-rails
  mysql2
  nested_form
  rails (= 3.2.13)
  rake (= 10.2.1)
  sass-rails (~> 3.2.3)
  uglifier (>= 1.0.3)

【问题讨论】:

  • Rails 版本:4.2.5 Ruby 版本:2.2.3-p173 (i386-mingw32) 系统:Windows 10
  • 向上。我真的可以这样做吗?

标签: ruby-on-rails ruby


【解决方案1】:

我遵循了这个准则https://medium.com/@frontlineutils/installing-the-mysql2-rubyonrails-gem-on-windows-7-8-a028f44d87f3#.op5rwsf2e

由于我不再使用 Windows,我无法再次对其进行测试,但它应该仍然可以工作。

【讨论】:

  • 执行gem install mysql2 --platform=ruby  --with-mysql-dir="C:\mysql-connector-path" 时的输出是什么?使用正确的 mysql-connector-path
  • 好的,你有没有从这里下载 mysql-connector 的 zip 压缩包:dev.mysql.com/downloads/connector/c 假设你已经解压了 mysql-connector-c-6.1.6-win32e: 的根目录要运行的命令是:gem install mysql2 --platform=ruby --with-mysql-dir="e:\mysql-connector-c-6.1.6-win32"
  • 并带有:gem install mysql2 --platform=ruby -- '--with-mysql-dir="e:/mysql-connector-c-6.1.6-win32"'(斜杠而不是反斜杠)否则,我真的不知道会发生什么。它对我有用
  • 嘿,刚认出来。我在哪里可以找到这个dll?我从 mysql-connector-c-6.1.6-win32/lib 中获取它。但是这个 bin 文件夹在哪里?原因 mysql-connector-c-6.1.6-win32/bin 不包含 libmysql.dll。那么mysql_files/bin在哪里呢?
  • 我认为帖子的作者只是输入了错误的文件夹名称。对我来说,dll 位于 /lib 文件夹下。当您执行bundle install 时,您现在得到了什么
猜你喜欢
  • 2012-02-26
  • 2015-02-25
  • 2019-07-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-07-20
  • 2023-03-12
  • 1970-01-01
相关资源
最近更新 更多