ruby-on-rails - 如何在 win 7 上安装 caldecott?

标签 ruby-on-rails ruby rubygems

我已经创建了一个,我想在 phpfog 上上传它,但是我在第一步上传我的数据库时遇到了麻烦,我有 win 7 x64,我下载并安装了带有 ruby​​ 的命令提示符,同时创建了一个隧道:

 C:\Ruby200\devkit>gem install caldecott --platform=ruby
    Temporarily enhancing PATH to include DevKit...
    Building native extensions.  This could take a while...
    ERROR:  Error installing caldecott:
            ERROR: Failed to build gem native extension.

        C:/Ruby200/bin/ruby.exe extconf.rb
    creating Makefile

    make
    generating generator-i386-mingw32.def
    compiling generator.c
    generator.c: In function 'cState_aref':
    generator.c:632:5: warning: variable 'state' set but not used [-Wunused-but-set-
    variable]
    generator.c: In function 'isArrayOrObject':
    generator.c:867:5: warning: suggest parentheses around '&&' within '||' [-Wparen
    theses]
    linking shared-object json/ext/generator.so

    make install
    /usr/bin/install -c -m 0755 generator.so C:/Ruby200/lib/ruby/gems/2.0.0/gems/jso
    n-1.6.8/ext/json/ext/json/ext
    /usr/bin/install: cannot create regular file `C:/Ruby200/lib/ruby/gems/2.0.0/gem
    s/json-1.6.8/ext/json/ext/json/ext': No such file or directory
    make: *** [install-so] Error 1


    Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.
    8 for inspection.
    Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/json-1.6.8/ext/json/ext/ge
    nerator/gem_make.out

    C:\Ruby200\devkit>gem install caldecott --platform=ruby


`

最佳答案

我有 Win7 x64、Ruby 2.0.0、DevKit (DevKit-mingw64-32-4.7.2-20130224-1151)

我遇到了同样的问题。我的解决方案:

  1. 从 github 下载 gem 源代码 - https://github.com/cloudfoundry/caldecott/archive/master.zip
  2. 解压到C:\caldecott(例如)
  3. 打开文件 caldecott.gemspec 并将 json 依赖项的版本更改为“~> 1.7”
  4. 打开命令提示符,移动到 gem 源目录并执行:

    gem 构建 caldecott.gemspec

    gem 安装 caldecott-0.0.5.gem

就这样

关于ruby-on-rails - 如何在 win 7 上安装 caldecott?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15312522/

相关文章:

ruby-on-rails - rails 4 在初始化器中使用应用程序助手

ruby-on-rails - 如何将特定的 ruby​​ gem 升级到特定(或最新)版本?

ruby - 安装 ruby​​gems 时出错

ruby-on-rails - 如何确保我的 Capybara 测试中的每个场景都不会调用 Redis 和 thinking sphinx

ruby - 如何向数组中插入元素

jquery - Rails 4. jQuery、Acts_as_list、嵌套模型、更新 Controller 中的位置

ruby-on-rails - sort_by 在 Rails 中使用 boolean 值

ruby-on-rails - 如何在 Rails 项目中设置 Wistia ruby​​ gem

ruby-on-rails - 开始使用 MiniTest 和 Rails

ruby-on-rails - 在 Rails 上使用 Ruby 1.9 是否可行?