繁体   English   中英

无法运行中间人服务器(捆绑安装现在可以工作)

[英]Can not run middleman server (bundle install now work)

我在中间人处启动服务器时遇到问题。 请帮忙。 我不严格要求,这对我来说是一个新事物。 我现在使用 linux mint ......希望它对我在 stackoverflow 上的这个主题有所帮助但这对我不起作用......并且捆绑更新&&捆绑安装,不适用于......

sudo apt-get install ruby​​-dev

最新版本(1:2.3.0 + 1)的ruby-dev包已经安装。


我使用的命令和控制台输出:

$ bundle exec 中间人服务器

Could not find json-1.8.1 in any of the sources
Run `bundle install` to install missing gems.

$ sudo 捆绑安装

[sudo] пароль для user: 
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from http://rubygems.org/............
Using i18n 0.6.11
Fetching json 1.8.1
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20171204-6004-665r95.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but
only 1 given
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                           ^
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer
without a cast [-Wint-conversion]
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                ^
Makefile:239: ошибка выполнения рецепта для цели «generator.o»
make: *** [generator.o] Ошибка 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.1 for
inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/json-1.8.1/gem_make.out

An error occurred while installing json (1.8.1), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

In Gemfile:
  middleman was resolved to 3.3.5, which depends on
    middleman-sprockets was resolved to 3.3.7, which depends on
      middleman-core was resolved to 3.3.5, which depends on
        padrino-helpers was resolved to 0.12.3, which depends on
          padrino-support was resolved to 0.12.3, which depends on
            activesupport was resolved to 4.1.5, which depends on
              json

好的......我在总结中写道:

$ gem install json -v '1.8.1

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.3.0 directory.

好的……没问题!

$ sudo gem install json -v '1.8.1'

Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20171204-6068-15letpl.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                               ^
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                    ^
Makefile:239: ошибка выполнения рецепта для цели «generator.o»
make: *** [generator.o] Ошибка 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/json-1.8.1/gem_make.out`enter code here`

嗯...

如果我使用命令

$ 捆绑更新

我看下一个:

The dependency wdm (~> 0.1.0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32`.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mswin32, x86-mingw32. To add those platforms to the bundle, run `bundle lock --add-platform x86-mswin32 x86-mingw32`.
Fetching gem metadata from http://rubygems.org/............
Fetching gem metadata from http://rubygems.org/.
Resolving dependencies....
Using i18n 0.7.0 (was 0.6.11)
Using json 1.8.6 (was 1.8.1)
Using minitest 5.10.3 (was 5.4.0)
Using thread_safe 0.3.6 (was 0.3.4)
Using tzinfo 1.2.4 (was 1.2.2)
Using activesupport 4.1.16 (was 4.1.5)
Using builder 3.2.3 (was 3.2.2)
Using bundler 1.16.0
Using hitimes 1.2.6
Using timers 4.0.4 (was 1.1.0)
Using celluloid 0.16.0 (was 0.15.2)
Using chunky_png 1.3.8 (was 1.3.1)
Using coffee-script-source 1.12.2 (was 1.7.1)
Using execjs 2.7.0 (was 2.2.1)
Using coffee-script 2.4.1 (was 2.3.0)
Using multi_json 1.12.2 (was 1.10.1)
Using sass 3.4.25 (was 3.3.14)
Using compass-core 1.0.3 (was 1.0.0)
Using compass-import-once 1.0.5
Using rb-fsevent 0.10.2 (was 0.9.4)
Using ffi 1.9.18 (was 1.9.3)
Using rb-inotify 0.9.10 (was 0.9.5)
Using compass 1.0.3 (was 1.0.0)
Fetching eventmachine 1.2.5 (was 1.0.3)
Installing eventmachine 1.2.5 (was 1.0.3) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/ext
/usr/bin/ruby2.3 -r ./siteconf20171204-9122-1fcu0r1.rb extconf.rb
checking for main() in -lcrypto... no
checking for openssl/ssl.h... no
checking for main() in -lcrypto... no
checking for openssl/ssl.h... no
checking for main() in -lcrypto... no
checking for openssl/ssl.h... no
checking for main() in -lcrypto... no
checking for openssl/ssl.h... no
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... yes
checking for accept4() in sys/socket.h... yes
checking for SOCK_CLOEXEC in sys/socket.h... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
checking for clock_gettime()... yes
checking for CLOCK_MONOTONIC_RAW in time.h... yes
checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=-g -O2 -fstack-protector-strong -Wformat -Werror=format-security
creating Makefile

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

  /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/eventmachine-1.2.5/mkmf.log

current directory: /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/ext
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/eventmachine-1.2.5/ext
make "DESTDIR="
compiling binder.cpp
make: g++: Команда не найдена
Makefile:231: ошибка выполнения рецепта для цели «binder.o»
make: *** [binder.o] Ошибка 127

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/eventmachine-1.2.5
for inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/eventmachine-1.2.5/gem_make.out

An error occurred while installing eventmachine (1.2.5), and Bundler
cannot continue.
Make sure that `gem install eventmachine -v '1.2.5'` succeeds before
bundling.

In Gemfile:
  middleman-livereload was resolved to 3.1.1, which depends on
    em-websocket was resolved to 0.5.1, which depends on
      eventmachine

或者

$ 捆绑安装

Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching gem metadata from http://rubygems.org/............
Using i18n 0.6.11
Fetching json 1.8.1
Installing json 1.8.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
/usr/bin/ruby2.3 -r ./siteconf20171204-9328-qz84bl.rb extconf.rb
creating Makefile

current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: /var/lib/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function ‘fbuffer_to_s’:
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but
only 1 given
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                                               ^
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer
without a cast [-Wint-conversion]
     VALUE result = rb_str_new(FBUFFER_PAIR(fb));
                    ^
Makefile:239: ошибка выполнения рецепта для цели «generator.o»
make: *** [generator.o] Ошибка 1

make failed, exit code 2

Gem files will remain installed in /var/lib/gems/2.3.0/gems/json-1.8.1 for
inspection.
Results logged to
/var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/json-1.8.1/gem_make.out

An error occurred while installing json (1.8.1), and Bundler cannot
continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

In Gemfile:
  middleman was resolved to 3.3.5, which depends on
    middleman-sprockets was resolved to 3.3.7, which depends on
      middleman-core was resolved to 3.3.5, which depends on
        padrino-helpers was resolved to 0.12.3, which depends on
          padrino-support was resolved to 0.12.3, which depends on
            activesupport was resolved to 4.1.5, which depends on
              json

一些恶性循环

问题非常平庸:找不到g ++。

决定很简单:

首先

$ sudo apt-get install build-essential

其次

$ sudo gem install eventmachine -v '1.2.5'

第三

$ sudo 捆绑更新

在第四

$ sudo 捆绑安装

在第五 - cd 到你的中间人项目,最后

$ bundle exec 中间人服务器

在 Linux Mint 18.3 Sylvia(伴侣 32 位)上工作

谢谢大家。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM