我无法运行middleman
服务器,因为没有安装依赖项therubyracer-heroku
!
我尝试通过以下命令安装middleman
:
gem install middleman
它成功了。当我使用默认配置启动中间人服务器时:
$ middleman server -p 3456 -e development
我收到了这些错误:
$ middleman server -p 3456 -e development
Could not find libv8-3.11.8.13 in any of the sources
Run `bundle install` to install missing gems.
$ bundle install
src/bootstrapper.cc: In static member function 'static bool v8::internal::Genesis::CompileScriptCached(v8::internal::Vector<const char>, v8::internal::Handle<v8::internal::String>, v8::internal::SourceCodeCache*, v8::Extension*, v8::internal::Handle<v8::internal::Context>, bool)':
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** 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=/home/praveen/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
extconf.rb:9:in `<main>': Error compiling V8 (RuntimeError)
Gem files will remain installed in /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3 for inspection.
Results logged to /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3/ext/v8/gem_make.out
An error occurred while installing therubyracer-heroku (0.8.1.pre3), and Bundler cannot continue.
Make sure that `gem install therubyracer-heroku -v '0.8.1.pre3'` succeeds before bundling.
$
我尝试卸载libv8
并重新安装。没有用。好吧,我试过的是:
gem uninstall libv8
gem install therubyracer-heroku
gem install therubyracer-heroku -v '0.8.1.pre3'
gem install therubyracer-heroku-0.8.1.pre3 # psst: I know this is crazy.
gem install therubyracer # succeeded, but this is not what I need.
gem install bundler
gem install bundle
bundle install # crazy things I tried but no luck!
gem install therubyracer-heroku -v '0.8.1.pre3'
src/bootstrapper.cc:1002:18: error: variable 'result' set but not used [-Werror=unused-but-set-variable]
src/bootstrapper.cc: In member function 'bool v8::internal::Genesis::InstallNatives()':
src/bootstrapper.cc:1227:24: error: variable 'name' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors
scons: *** [obj/release/bootstrapper.o] Error 1
scons: building terminated because of errors.
make: *** [build/v8/libv8.a] Error 2
*** 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=/home/praveen/.rvm/rubies/ruby-1.9.3-p286/bin/ruby
extconf.rb:9:in `<main>': Error compiling V8 (RuntimeError)
Gem files will remain installed in /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3 for inspection.
Results logged to /home/praveen/.rvm/gems/ruby-1.9.3-p286/gems/therubyracer-heroku-0.8.1.pre3/ext/v8/gem_make.out
Gemfile
您的信息内容!
source 'https://rubygems.org'
gem "thin"
gem "rack-contrib"
gem "middleman"
gem "middleman-livereload", :git => "https://github.com/middleman/middleman-livereload.git"
gem "middleman-smusher", :git => "https://github.com/middleman/middleman-smusher.git"
gem "middleman-favicon-maker", :git => "https://github.com/follmann/middleman-favicon-maker.git"
gem "slim"
gem "compass-rgbapng"
gem "sassy-buttons"
group :development do
gem 'heroku'
gem 'foreman'
gem 'therubyracer-heroku', '0.8.1.pre3'
gem 'oj'
end
group :production do
gem 'therubyracer-heroku', '0.8.1.pre3'
gem 'oj'
end
那么,有什么想法可以解决这个问题吗?
答案 0 :(得分:1)
请使用当前版本的therubyracer(撰写本文时为0.11.4),不 therubyracer-heroku。由于主宝石与heroku兼容且不再维护,因此不再需要它。
普通宝石现在与heroku兼容,所以只是
gem "therubyracer"
你Gemfile
中的应该做的伎俩