1

我試圖在Windows 7 64位的Ruby on Rails項目中運行bundle install,但由於therubyracer gem 。我在Ubuntu中開發它,但我需要將它作爲Windows 7計算機中的產品運行。Windows 7中的Ruby on Rails 4:使用錯誤的therubyracer gem安裝的Bundle安裝

搜索後,我發現我應該在這裏使用這個寶石:https://github.com/eakmotion/therubyracer_for_windows/blob/master。它似乎已經在我的寶石中安裝了therubyracer-0.11.0beta1-x86-mingw32。我還安裝使用gem install libv8 -v '3.16.14.7' -- --with-system-v8的libv8,如gem install libv8 --version '3.11.8.17' on ruby (windows)

不過的建議,我遵循寶石的安裝說明bundle install仍嘗試安裝therubyracer寶石(0.12.1版本),即使在。所以,我的問題是:我怎樣才能使用我手動安裝的therubyracer gem來運行軟件包安裝?

版本:2.1.5紅寶石,導軌4.1.8,使用Rails Installer安裝的http://www.railsinstaller.org/en

的Gemfile中的相關線路:

gem "therubyracer" 
gem "less-rails" 
gem "twitter-bootstrap-rails" 

如果我對"therubyracer_for_windows"交換"therubyracer",我得到一個錯誤消息Could not find gem 'therubyracer_for_windows (>= 0) ruby' in the gems available on this machine.當我嘗試做一個bundle install

bundle install錯誤消息:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    current directory: C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/ther 
ubyracer-0.12.1/ext/v8 
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe -r ./siteconf20160211-944-u6p7vs.rb ext 
conf.rb 
checking for main() in -lpthread... no 
checking for v8.h... no 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of necessary 
libraries and/or headers. Check the mkmf.log file for more details. You may 
need configuration options. 

Provided configuration options: 
     --with-opt-dir 
     --without-opt-dir 
     --with-opt-include 
     --without-opt-include=${opt-dir}/include 
     --with-opt-lib 
     --without-opt-lib=${opt-dir}/lib 
     --with-make-prog 
     --without-make-prog 
     --srcdir=. 
     --curdir 
     --ruby=C:/RailsInstaller/Ruby2.1.0/bin/ruby 
     --with-pthreadlib 
     --without-pthreadlib 
     --enable-debug 
     --disable-debug 
     --with-v8-dir 
     --without-v8-dir 
     --with-v8-include 
     --without-v8-include=${v8-dir}/include 
     --with-v8-lib 
     --without-v8-lib=${v8-dir}/lib 
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.7/ext/libv8/l 
ocation.rb:50:in `configure': You have chosen to use the version of V8 found on 
your system (Libv8::Location::System::NotFoundError) 
and *not* the one that is bundle with the libv8 rubygem. However, 
it could not be located. please make sure you have a version of 
v8 that is compatible with 3.16.14.7 installed. You may 
need to special --with-v8-dir options if it is in a non-standard 
location 

thanks, 
The Mgmt 

     from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/libv8-3.16.14. 
7/lib/libv8.rb:7:in `configure_makefile' 
     from extconf.rb:32:in `<main>' 

To see why this extension failed to compile, please check the mkmf.log which can 
be found here: 

    C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/t 
herubyracer-0.12.1/mkmf.log 

回答

0

嘗試在Gemfile中指定的版本,如:

gem "therubyracer", "0.11.0beta1" 

我至少有成功獲得束安裝完成的方式。

+0

對於我所記得的,我試圖做到這一點,但也許我做了一個錯誤的therubyracer版本。只要我可以,我會再試一次。 在此先感謝! –

+0

@BrianHellekin我已經遇到了一個同事的Windows機器,但即使得到它建立後,我得到一些崩潰運行任何引導軌道代碼,試圖包括V8。最終我只是放棄了,並用了一個vm –

+0

我再次嘗試,沒有成功。當我嘗試最後一次放棄時,我卻成功地運行了一臺運行Ubuntu或CentOS的虛擬機 - 即使Cygwin失敗了...... –