WINDOWS上的Rails:安装therubyracer和libv8 – 在MAC上设计的网站上工作

我有一个开发的网站是关于MAC的RoR v 4.2.4需要一些调整,我试图在我的Windows 10上运行(因为我没有MAC)。我没有成功使用rails安装程序和rails 5.0。

使用ruby 2.2.6安装RoR 4.2.4后出了很多痛苦我使用bundle checkbundle installgem install xyz -v 0.0...设法安装了几乎所有缺失的gem。 但现在我真的陷入了最后的2: therubyracerlibv8

我尝试了什么:

安装libv8与gem install libv8 -v 3.16.14.11 -- --with-system-v8以及此处提到的therubyracer-for-windows。

修改gemfile.lock以消除依赖关系,如:

 group :production do gem 'therubyracer' end 

并尝试bundle install --without production 。 但是在启动服务器时出现错误。

目前bundle check说,therubyracer v 0.12.2是最后遗失的gem。 libv8与--with-system-v8一起安装。 gem list说libv8(3.16.14.11)和therubyracer(0.11.0b)已安装,但系统似乎没有找到therubyracer,因为: therubyracer -v不起作用。 另外bundle install给我以下错误:

 C:/Ruby22-x64/bin/ruby.exe -r ./siteconf20170122-10664-jwvn48.rb extconf.rb --with-v8-dir=/usr/local/opt/v8-315 checking for main() in -lpthread... yes 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:/Ruby22-x64/bin/$(RUBY_BASE_NAME) --with-pthreadlib --without-pthreadlib --enable-debug --disable-debug --with-v8-dir --with-v8-include --without-v8-include=${v8-dir}/include --with-v8-lib --without-v8-lib=${v8-dir}/lib C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.11/ext/libv8/location.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.11 installed. You may need to special --with-v8-dir options if it is in a non-standard location thanks, The Mgmt from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.11/lib/libv8.rb:7:in `configure_makefile' from extconf.rb:32:in `' extconf failed, exit code 1 Gem files will remain installed in C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/therubyracer-0.12.2 for inspection. Results logged to C:/Ruby22-x64/lib/ruby/gems/2.2.0/extensions/x64-mingw32/2.2.0/therubyracer-0.12.2/gem_make.out An error occurred while installing therubyracer (0.12.2), and Bundler cannot continue. Make sure that `gem install therubyracer -v '0.12.2'` succeeds before bundling. 

在我使用--with-system-v8安装libv8之后尝试安装therubyracer时,此错误至少类似于我之前获得的所有错误。

对不起,如果这个信息有点混乱,但我现在尝试了很多东西,并且并不总是100%确定我在做什么:)很难总结尽可能多。 如果缺少重要信息,请告诉我。

顺便说一句:我尽可能地遵循本指南。 使用rails new blog创建/开发一个新网站并为其运行服务器完美无缺…问题只出现在我必须完成的现有网站上。

有人能帮我吗? 有没有办法让我的Windows PC上运行该网站? 谢谢!