1

问题

我无法运行服务器,因为没有安装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

那么,有什么想法可以解决这个问题吗?

4

1 回答 1

1

请使用当前版本的 therubyracer(撰写本文时为 0.11.4),而不是therubyracer-heroku。不再需要它,因为主 gem 与 heroku 兼容并且不再维护。

普通 gem 现在与 heroku 兼容,所以只要

gem "therubyracer"

在你Gemfile应该做的伎俩

于 2013-05-03T14:33:43.183 回答