我在MAC上开发了一个RoR v 4.2.4的网站,需要一些调整,我试图在我的Windows 10上运行(因为我没有MAC)。我使用rails安装程序和rails 5.0没有成功。
使用ruby 2.2.6安装RoR 4.2.4后出了很多痛苦我使用bundle check
,bundle install
和gem install xyz -v 0.0...
设法安装了几乎所有缺失的宝石。但现在我真的坚持了最后2:
therubyracer 和 libv8
我尝试了什么:
使用gem install libv8 -v 3.16.14.11 -- --with-system-v8
安装libv8以及提到here的therubyracer-for-windows。
修改gemfile.lock以消除依赖:
group :production do
gem 'therubyracer'
end
并尝试bundle install --without production
。但是在启动服务器时出现错误。
目前bundle check
说,therubyracer v 0.12.2是最后遗失的宝石。 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 `<main>'
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%确定我在做什么:)...很难总结尽可能多。如果缺少重要信息,请告诉我。
顺便说一句:我尽可能地遵循this指南。使用rails new blog
创建/开发一个新网站,并为其运行服务器完美无缺...问题只出现在我必须完成的现有网站上。
有人能帮助我吗?有没有办法让我的Windows PC上运行该网站?谢谢!