2013-07-26 45 views
2

我想使用Big Cartel的名爲Dugway的Ruby Gem在本地環境中創建主題,而不是在其實際平臺上進行開發。用Ruby Gems和dugway安裝迷失方向

我以前從未使用Ruby或Gems,但爲了理解,我需要首先安裝Ruby和DevKit。我下載並安裝了Ruby 2.0.0-p247 (x64)DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe,然後將DevKit提取到Ruby文件夾中。

我跟着指示here,但只是爲了保持它在一個地方我會寫什麼無論如何,我是......

我打開啓動命令提示符使用Ruby和類型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]其中我a ssumed意味着它正常工作!

所以現在與大卡特爾達格威寶石,I型gem install dugway這給我的錯誤:

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

快速搜索我看了國際化是一個寶石本身,所以...的假設是什麼,我正瞭解如何安裝寶石讓我認爲gem install i18n應寫入命令提示符,這安裝沒有警告或錯誤謝天謝地。所以我試圖再次安裝dugway gem install dugway,我得到了和以前一樣的錯誤,那個dugway需要i18​​n。

我現在很困惑,說一個小時前,我沒有任何線索說明這是什麼意思,我認爲到目前爲止我做得很好,但我堅持接下來要做的事情。

我如何解決最後一個錯誤,對我來說,它的安裝,所以我做錯了什麼?很抱歉,如果它很明顯,但正如我所說的,這對我來說是非常新的,我習慣於編寫PHP和運行數據庫,所以我仍在調整!

編輯

要注意的,我也試着在gem install dugway以防萬一到底這是一個問題增加--platform-ruby,但仍然得到了同樣的錯誤。

編輯

以下迫使特定的國際化版本安裝的西蒙Repp的意見後:

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 

然後試圖達格威重新安裝,一切都進行得很順利,直到最後:

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> 

回答

1

gem list i18n你可以得到你安裝的i18n gem的版本信息編輯。
(應以括號,像i18n (x.x.x)

機會是你已經安裝的版本是不0.6.1(其中,根據你的錯誤信息是達格威需要工作國際化的確切版本)

如果是這樣,你可以嘗試gem install i18n --version '= 0.6.1'自己安裝該特定版本。

不幸的是,這很可能會失敗,因爲如果寶石可以爲你安裝就像那樣,rubygems可能已經爲你做了。但是 - 無論你收到什麼樣的錯誤,都會導致問題的深層原因,並因此至少向前邁進一步;)

+0

好吧,它比上次更進一步,非常感謝版本安裝!我試圖理解它拋出的錯誤,但沒有太多的運氣!結果編輯了我的原始問題。 – Joe

3

我設法通過卸載64位版本的Ruby和DevKit。

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

Ruby安裝到C:\Ruby200\,我將DevKit提取到C:\Ruby200\devkit\

開業紅寶石命令提示符,並執行以下操作:

更改路徑,初始化,然後再安裝。測試它就像他們在RubyInstall DevKit上所說的那樣安裝了json(幾次關於ASCII到UTF-8轉換的警告,但沒有錯誤)。

測試了json安裝,然後安裝了i18n 0.6.1版本,就像Dugway說的那樣。試圖安裝Dugway,但它說activesupport requires i18n (>= 0.6.4, ~> 0.,所以我安裝了國際化的0.6.4,看看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或就像我說的寶石,我不知道它們是64位版本的任何一個出了問題還是它的結尾都是錯的,但無論哪種方式,這對我都有效!

使用dugway本身還存在問題,但至少已經安裝好了,我現在正在聯繫dugway自己解決的問題。

+0

如果您報告有關在wnidows上使用ruby時遇到的這些問題,這很好。儘管如此,我發現注意到大多數Ruby社區更喜歡在* nix系統(通常是linux或MacOS)上工作是很重要的,而且作爲初學者在其中一個系統上使用ruby會更容易。 –