在Ubuntu中安装Middleman时遇到问题

我使用gem install middleman安装了中间人,并且可以看到本地宝石列表中列出的宝石

middleman (4.3.5) middleman-cli (4.3.5) middleman-core(4.3.5

但是当我输入middleman -v时,我得到了
Unknown switches "-v"

如果我输入middleman --version,我会得到
Unknown switches "--version" Did you mean? "--verbose"

which middleman返回home/.rbenv/shims/middleman which ruby返回home/.rbenv/shims/ruby 我默认运行的是Ruby 2.6.3版 在Ubuntu 18.04上

我已经尝试安装Middleman两天了,并且一直遇到问题;变成了噩梦!

admancy 回答:在Ubuntu中安装Middleman时遇到问题

到底是什么问题? middleman已成功安装。它只是不支持您尝试通过的开关。您是否尝试过README中定义的middleman init project_name?因为您收到的错误消息表明您正确安装了Middleman,并且可以正常工作。您只需要运行它,就像这样:

foo:~|⇒  which middleman
/Users/foo/.rvm/gems/ruby-2.6.3/bin/middleman
foo:~|⇒  middleman
/Users/foo/.rvm/gems/ruby-2.6.3/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
== Could not find a Middleman project config.rb
foo:~|⇒  middleman --version
/Users/foo/.rvm/gems/ruby-2.6.3/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
Unknown switches "--version"
Did you mean?  "--verbose"
foo:~|⇒  middleman init foo
/Users/foo/.rvm/gems/ruby-2.6.3/gems/activesupport-4.2.11.1/lib/active_support/core_ext/object/duplicable.rb:111: warning: BigDecimal.new is deprecated; use BigDecimal() method instead.
         run  git clone --depth 1 https://github.com/middleman/middleman-templates-default.git /var/folders/ts/qq2cd6pn42d15jrhc36cxbtw0000gn/T/d20191106-69912-29f30z from "."
Cloning into '/var/folders/ts/qq2cd6pn42d15jrhc36cxbtw0000gn/T/d20191106-69912-29f30z'...
remote: Enumerating objects: 19,done.
remote: Counting objects: 100% (19/19),done.
remote: Compressing objects: 100% (11/11),done.
remote: Total 19 (delta 0),reused 12 (delta 0),pack-reused 0
Unpacking objects: 100% (19/19),done.
       exist
      create  .gitignore
      create  Gemfile
      create  config.rb
      create  source/images/.keep
      create  source/index.html.erb
      create  source/javascripts/site.js
      create  source/layouts/layout.erb
      create  source/stylesheets/site.css.scss
         run  bundle install from "./foo"
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,java,x64-mingw32. To add those platforms to the bundle,run `bundle lock --add-platform x86-mswin32 x86-mingw32 java x64-mingw32`.
The dependency wdm (~> 0.1) 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,run `bundle lock --add-platform x86-mswin32 x86-mingw32 x64-mingw32`.
Fetching gem metadata from https://rubygems.org/...............
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using concurrent-ruby 1.1.5
Using i18n 0.9.5
Fetching minitest 5.13.0
Installing minitest 5.13.0
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Fetching activesupport 5.0.7.2
Installing activesupport 5.0.7.2
Fetching public_suffix 4.0.1
Installing public_suffix 4.0.1
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using execjs 2.7.0
Fetching autoprefixer-rails 9.7.1
Installing autoprefixer-rails 9.7.1
Using backports 3.15.0
Using bundler 1.17.3
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using contracts 0.13.0
Using dotenv 2.7.5
Using erubis 2.7.0
Using fast_blank 1.0.0
Using fastimage 2.1.7
Using ffi 1.11.1
Using temple 0.8.2
Fetching tilt 2.0.10
Installing tilt 2.0.10
Using haml 5.1.2
Using hamster 3.0.0
Using hashie 3.6.0
Using kramdown 1.17.0
Using rb-fsevent 0.10.3
Using rb-inotify 0.10.0
Using listen 3.0.8
Using memoist 0.16.0
Using thor 0.20.3
Using middleman-cli 4.3.5
Using padrino-support 0.13.3.4
Using padrino-helpers 0.13.3.4
Fetching parallel 1.18.0
Installing parallel 1.18.0
Using rack 2.0.7
Using sassc 2.2.1
Using servolux 0.13.0
Using uglifier 3.2.0
Using middleman-core 4.3.5
Using middleman 4.3.5
Fetching middleman-autoprefixer 2.10.1
Installing middleman-autoprefixer 2.10.1
Bundle complete! 4 Gemfile dependencies,42 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
foo:~|⇒
本文链接:https://www.f2er.com/3152467.html

大家都在问