Ruby Gems和dugway安装相当丢失

时间:2013-07-26 03:51:13

标签: ruby gem installation bigcartel

我想使用Big Cartel的一个名为Dugway的Ruby Gem来创建本地环境中的主题,而不是用于开发目的的实际平台。

我之前从未使用过Ruby或Gems,但根据我的理解,我需要先安装Ruby和DevKit。我下载并安装了Ruby 2.0.0-p247 (x64)DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe,然后将DevKit解压缩到Ruby文件夹中。

我按照here的说明进行操作,但只是为了将它们全部放在一个地方,我会完全写下我的所作所为......

我用Ruby打开了Start Command Prompt并键入了cd C:\Ruby200-x64\devkit然后ruby dk.rb init并得到了这个:

    Initialization complete! Please review and modify the auto-generated
    'config.yml' file to ensure it contains the root directories to all
    of the installed Rubies you want enhanced by the DevKit.

我查看了该文件,并在评论下面- C:/Ruby200-x64我认为这意味着因为我之前没有使用过任何东西,所以我无论如何都无法修改。

现在要安装,我输入ruby dk.rb install并显示:

    [INFO] Updating convenience notice gem override for 'C:/Ruby200-x64'
    [INFO] Installing 'C:/Ruby200-x64/lib/ruby/site_ruby/devkit.rb'

然后它告诉我进行测试安装,所以输入gem install json --platform=ruby给了我以下内容:

    Fetching: json-1.8.0.gem (100%)
    Temporarily enhancing PATH to include DevKit..
    Building native extensions. This could take a while...
    Successfully installed json-1.8.0
    Parsing documentation for json-1.8.0
    Unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
    Unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
    Installing ri documentation for json-1.8.0
    1 gem installed

我在这里快速搜索了无法转换警告的内容,并发现this让我感觉更好,因为它不是错误,这意味着我继续并输入ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect"并显示[42]我认为它意味着它正常工作!

现在使用Big Cartels Dugway gem,我输入gem install dugway,这给了我错误:

    ERROR: While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: dugway requires i18n (= 0.6.1)

快速搜索显示我i18n本身就是一个宝石,所以...我刚刚学到如何安装宝石的假设让我觉得gem install i18n应该写入命令提示符,这没有安装任何警告或者谢天谢地。所以我试图再次安装dugway gem install dugway并且我得到了与以前完全相同的错误,dugway需要i18​​n。

我现在很困惑,一小时前说我不知道​​这是什么意思,我以为我到目前为止做得很好,但我仍然坚持下一步该做什么。 / p>

如何绕过最后一个错误,对我来说它安装了,所以我做错了什么?对不起,如果它很明显,但就像我说的,这对我来说都是新手,我习惯于编写PHP并运行数据库,所以我还在调整!

修改

要注意,我还尝试在--platform-ruby的末尾添加gem install dugway以防万一有问题,但仍然遇到同样的错误。

修改

遵循Simon Repp关于强制安装特定i18n版本的建议:

ruby 2.0.0p247 (2013-06-27) [x64-mingw32]

C:\Users\Me>cd C:\Ruby200-x64\devkit

C:\Ruby200-x64\devkit>gem list i18n

*** LOCAL GEMS ***

i18n (0.6.4)

C:\Ruby200-x64\devkit>gem install i18n --version '= 0.6.1'
Fetching: i18n-0.6.1.gem (100%)
Successfully installed i18n-0.6.1
Parsing documentation for i18n-0.6.1
Installing ri documentation for i18n-0.6.1
1 gem installed

然后再次尝试安装dugway,一切顺利到最后:

C:\Ruby200-x64\devkit>gem install dugway
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5
Fetching: rack-1.4.5.gem (100%)
Successfully installed rack-1.4.5
Fetching: rack-mount-0.8.3.gem (100%)
Successfully installed rack-mount-0.8.3
Fetching: activesupport-3.2.14.gem (100%)
Successfully installed activesupport-3.2.14
Fetching: liquid-2.4.1.gem (100%)
Successfully installed liquid-2.4.1
Fetching: coffee-script-source-1.6.3.gem (100%)
Successfully installed coffee-script-source-1.6.3
Fetching: execjs-1.4.0.gem (100%)
Successfully installed execjs-1.4.0
Fetching: coffee-script-2.2.0.gem (100%)
Successfully installed coffee-script-2.2.0
Fetching: sass-3.2.9.gem (100%)
Successfully installed sass-3.2.9
Fetching: hike-1.2.3.gem (100%)
Successfully installed hike-1.2.3
Fetching: tilt-1.4.1.gem (100%)
Successfully installed tilt-1.4.1
Fetching: sprockets-2.10.0.gem (100%)
Successfully installed sprockets-2.10.0
Fetching: sprockets-sass-0.9.1.gem (100%)
Successfully installed sprockets-sass-0.9.1
Fetching: chunky_png-1.2.8.gem (100%)
Successfully installed chunky_png-1.2.8
Fetching: fssm-0.2.10.gem (100%)
Successfully installed fssm-0.2.10
Fetching: compass-0.12.2.gem (100%)
Successfully installed compass-0.12.2
Fetching: multi_xml-0.5.4.gem (100%)
Successfully installed multi_xml-0.5.4
Fetching: httparty-0.10.2.gem (100%)
When you HTTParty, you must party hard!
Successfully installed httparty-0.10.2
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: coderay-1.0.9.gem (100%)
Successfully installed coderay-1.0.9
Fetching: better_errors-0.6.0.gem (100%)
Successfully installed better_errors-0.6.0
Fetching: debug_inspector-0.0.2.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed debug_inspector-0.0.2
Fetching: binding_of_caller-0.7.2.gem (100%)
Building native extensions.  This could take a while...
Successfully installed binding_of_caller-0.7.2
Fetching: will_paginate-3.0.4.gem (100%)
Successfully installed will_paginate-3.0.4
Fetching: htmlentities-4.3.1.gem (100%)
Successfully installed htmlentities-4.3.1
Fetching: thor-0.17.0.gem (100%)
Successfully installed thor-0.17.0
Fetching: rubyzip-0.9.9.gem (100%)
Successfully installed rubyzip-0.9.9
Fetching: uglifier-1.3.0.gem (100%)
Successfully installed uglifier-1.3.0
Fetching: eventmachine-1.0.3.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing dugway:
        ERROR: Failed to build gem native extension.

C:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -lssl... no
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
creating Makefile

make "DESTDIR="
generating rubyeventmachine-x64-mingw32.def
compiling binder.cpp
In file included from c:\ruby200-x64\devkit\mingw\bin\../lib/gcc/x86_64-w64-ming
w32/4.7.2/../../../../x86_64-w64-mingw32/include/process.h:12:0,
                 from c:/Ruby200-x64/include/ruby-2.0.0/ruby/win32.h:60,
                 from c:/Ruby200-x64/include/ruby-2.0.0/ruby/defines.h:153,
                 from c:/Ruby200-x64/include/ruby-2.0.0/ruby/ruby.h:70,
                 from c:/Ruby200-x64/include/ruby-2.0.0/ruby.h:33,
                 from em.h:24,
                 from project.h:150,
                 from binder.cpp:20:
c:\ruby200-x64\devkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../
x86_64-w64-mingw32/include/sys/types.h:68:16: error: conflicting declaration 'ty
pedef _pid_t pid_t'
In file included from binder.cpp:20:0:
project.h:97:13: error: 'pid_t' has a previous declaration as 'typedef int pid_t
'
In file included from project.h:151:0,
                 from binder.cpp:20:
ed.h: In member function 'void EventableDescriptor::SetSocketInvalid()':
ed.h:43:40: warning: overflow in implicit constant conversion [-Woverflow]
make: *** [binder.o] Error 1


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/event
machine-1.0.3 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/ext
/gem_make.out

C:\Ruby200-x64\devkit>

2 个答案:

答案 0 :(得分:3)

我已经设法通过卸载Ruby和DevKit的64位版本来实现它。

如果其他人想知道我是如何工作的,我完全删除了Ruby和DevKit并下载了Ruby 2.0.0-p247DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe

Ruby安装到C:\Ruby200\,我将DevKit解压缩到C:\Ruby200\devkit\

打开Ruby命令提示符并执行以下操作:

更改路径,初始化然后安装。测试它就像他们在RubyInstall DevKit上通过安装json(再次发出关于ASCII到UTF-8转换但没有错误的几个警告)的说法。

测试了json安装,然后安装了版本i18n 0.6.1,因为这是Dugway所说的。试图安装Dugway,但它说activesupport requires i18n (>= 0.6.4, ~> 0.,所以我安装了0.6.4的i18n,看Dugway是否会安装。

再次安装Dugway,经过漫长的等待解析并再次安装几个ASCII到UTF-8转换,但Dugway最终安装完毕!

以下是我使用的命令列表,删除了所有结果以便于阅读:

C:\Users\Me> cd C:\Ruby200\devkit
C:\Ruby200\devkit> ruby dk.rb init
C:\Ruby200\devkit> ruby dk.rb install
C:\Ruby200\devkit> gem install json --platform=ruby
C:\Ruby200\devkit> ruby -rubygems -e "require 'json'; puts JSON.load('[42]').inspect
C:\Ruby200\devkit> gem install i18n --version '= 0.6.1'
C:\Ruby200\devkit> gem install i18n
C:\Ruby200\devkit> gem install dugway

希望能帮助那些遇到任何麻烦的人,因为我对Ruby或Gems不太了解,就像我说的那样,我不知道64bit版本中的任何一个是否有问题或者这是在dugways结束,但不管怎样,这对我有用!

使用dugway本身仍然存在问题,但至少已经安装了,我将在我现在面临的问题上与dugway联系。

答案 1 :(得分:1)

使用gem list i18n,您可以获得所安装的i18n gem的版本信息 (应该在括号中,类似于i18n (x.x.x)

您安装的版本可能不是0.6.1(根据您的错误消息,这是dugway需要工作的i18n的确切版本)

如果是这样,您可以尝试gem install i18n --version '= 0.6.1'自行安装该特定版本。

不幸的是,这很有可能会失败,因为如果宝石可以像你那样安装,那么rubygems可能已经为你完成了。但是 - 无论您遇到什么错误,都会引导您找到问题的深层原因,从而至少在您的路上迈出一步;)