为什么 Middleman 在安装后不包含 rb-inotify 和 therubyracer gem?

2023-12-19

I have:

$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
$ middleman version
Middleman 2.0.13.1
$ cat /etc/debian_version 
6.0.3

如果我像这样开始一个项目:



$ middleman init np --rack --bundler --template=html5 
      create  np/config.ru
      create  np/Gemfile
         run  bundle install
Fetching source index for http://rubygems.org/
Using multi_json (1.0.3) 
Using activesupport (3.1.1) 
Using addressable (2.2.6) 
Using chunky_png (1.2.5) 
Using coffee-script-source (1.1.2) 
Using execjs (1.2.9) 
Using coffee-script (2.2.0) 
Using fssm (0.2.7) 
Using sass (3.1.10) 
Using compass (0.11.5) 
Using daemons (1.1.4) 
Using eventmachine (0.12.10) 
Using em-websocket (0.3.3) 
Using thor (0.14.6) 
Using guard (0.6.3) 
Using guard-livereload (0.3.1) 
Using haml (3.1.3) 
Using hike (1.2.1) 
Using rack (1.3.5) 
Using url_mount (0.2.1) 
Using http_router (0.10.2) 
Using i18n (0.6.0) 
Using syntax (1.0.0) 
Using maruku (0.6.0) 
Using middleman-livereload (0.2.1) 
Using rack-protection (1.1.4) 
Using tilt (1.3.3) 
Using sinatra (1.3.1) 
Using padrino-core (0.10.5) 
Using padrino-helpers (0.10.5) 
Using rack-test (0.6.1) 
Using temple (0.3.4) 
Using slim (1.0.3) 
Using sprockets (2.0.3) 
Using thin (1.2.11) 
Using uglifier (1.0.4) 
Using middleman (2.0.13.1) 
Using bundler (1.0.21) 
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
      create  np/config.rb
      create  np/source
      create  np/source/404.html
      create  np/source/README.md
      create  np/source/apple-touch-icon-114x114-precomposed.png
      create  np/source/apple-touch-icon-57x57-precomposed.png
      create  np/source/apple-touch-icon-72x72-precomposed.png
      create  np/source/apple-touch-icon-precomposed.png
      create  np/source/apple-touch-icon.png
      create  np/source/crossdomain.xml
      create  np/source/css/style.css
      create  np/source/favicon.ico
      create  np/source/humans.txt
      create  np/source/img/.gitignore
      create  np/source/index.html
      create  np/source/js/libs/jquery-1.6.2.js
      create  np/source/js/libs/jquery-1.6.2.min.js
      create  np/source/js/libs/modernizr-2.0.6.min.js
      create  np/source/js/mylibs/.gitignore
      create  np/source/js/plugins.js
      create  np/source/js/script.js
      create  np/source/robots.txt
      create  np/source/test/index.html
      create  np/source/test/qunit/qunit.css
      create  np/source/test/qunit/qunit.js
      create  np/source/test/tests.js
       exist  np/source
  

并进入目录以运行预览:



$ cd np/
$ middleman server
Please install rb-inotify gem for Linux inotify support
Using polling (Please help us to support your system better than that.)
Using inline Guardfile.
Guard is now watching at '/tmp/np'
/home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs/runtimes.rb:47:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs.rb:5:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/execjs-1.2.9/lib/execjs.rb:4:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `require'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/renderers/coffee_script.rb:4:in `require'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/renderers/coffee_script.rb:4:in `registered'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1262:in `block in register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/core_extensions/rendering.rb:14:in `registered'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1262:in `block in register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/base.rb:54:in `registered'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1262:in `block in register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/sinatra-1.3.1/lib/sinatra/base.rb:1260:in `register'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman.rb:180:in `server'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman.rb:191:in `start_server'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:58:in `block in server_start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:57:in `fork'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:57:in `server_start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:47:in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:66:in `supervised_task'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:43:in `block in start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:43:in `each'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/guard-0.6.3/lib/guard.rb:43:in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/guard.rb:34:in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/lib/middleman/cli.rb:55:in `server'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor.rb:263:in `dispatch'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:52:in `start_cli!'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:47:in `did_locate_middleman_project'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:20:in `locate_middleman_root!'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/gems/middleman-2.0.13.1/bin/middleman:70:in `'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/bin/middleman:19:in `load'
    from /home/blt/.rvm/gems/ruby-1.9.2-p290/bin/middleman:19:in `'
Bye bye...
  

尽管那样:



$ gem list | grep racer
therubyracer (0.9.8)

$ gem list | grep inotify
rb-inotify (0.8.8)
  

我按照RVM安装指南 http://beginrescueend.com/rvm/install/和中间人入门 http://middlemanapp.com/guides/getting-started。有什么想法为什么 Middleman 无法启动服务器吗?


看起来middleman server用户使用仅基于 Gemfile 的沙箱。如果您已经全局安装了 gem,它们将不会在运行时出现在沙箱中。原始 Gemfile 创建者middleman init好像:

source "http://rubygems.org"
gem "middleman", "~>2.0.13.1"

将其编辑为:

source "http://rubygems.org"

gem "middleman", "~>2.0.13.1"
gem "rb-inotify"
gem "therubyracer"

如果您愿意,您可以不那么懒惰,并通过操作系统对其进行参数化。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

为什么 Middleman 在安装后不包含 rb-inotify 和 therubyracer gem? 的相关文章

  • Elastic Beanstalk、Bundler 找不到 gem“bundler”的兼容版本

    我已经尝试过将 Elastic Beanstalk 用于 Rails 当我运行 eb deploy 时出现此错误 我需要至少安装bundler 1 8 4 知道如何解决这个问题吗 Bundler could not find compati
  • 使用mongoid动态创建索引

    我有一项为我的文档创建新字段的工作 我想在这项工作结束时创建该字段的索引 我试过 Model index field gt 1 and also Mongoid Sessions default rating prediction ensu
  • 从架构中删除表 - Rails

    我想删除架构中的一个表 我在第一次启动项目时创建了数据库并希望删除该表 这样做的最佳方法是什么 I tried rails g migration drop table installs但这只会创建一个空迁移 Schema create t
  • 使用旧的 ruby​​gems 版本进行捆绑安装

    我遇到的问题似乎与1个月前的问题 https stackoverflow com questions 38279896 rubygems 2 0 14 is not threadsafe bunder install message whe
  • 使用 rbenv 在 MacOS 上安装 Ruby 2.6.0 失败

    我在 Mojave 上有一台 Mac 它无法安装开发所需的一些基本内容 rbenv install 2 6 0 Downloading openssl 1 1 1d tar gz gt https dqw8nmjcqpjn7 cloudfr
  • 在 Rails 3.2 + SimpleForm 中显示嵌套表单有错误的字段

    我有一个Flight模型嵌套在一个FlightLog模型 AFlightLog可能包含许多航班 我使用 SimpleForm 进行引导安装 这样当验证失败时 可以用错误类包围带有错误的表单元素 问题是 即使触发了嵌套模型的验证 simple
  • Selenium 找不到“spec”文件夹

    因此 我正在尝试建立本地系统来帮助完成仅使用 Rails 的雇主的现有项目 他们希望我主要关注 rspec 测试 因为该项目几乎可以正常运行 我需要充实他们错过的东西 但是 我无法获取 rake spec 来构建我的测试文件夹 事实上 测试
  • 使用 Ruby on Rails 进行设计 - 强制用户在首次登录时更改密码

    我有一个运行 Devise 的 RoR 应用程序 Rails 4 2 Ruby 2 2 0 我已经进行了设置 以便管理员用户 标识了我添加到用户模型中的 is admin 布尔值 能够创建新的用户帐户 为他们提供生成的密码和确认电子邮件 这
  • 如何在 Ruby 中列出局部变量?

    def method a 3 b 4 some method that gives a b end 局部变量 http ruby doc org core Kernel html method i local variables 它输出符号
  • Inotify linux 监视子目录

    是否可以以这种模式监视目录 storage data usernames Download gt storage data Download 我需要监视每个用户的下载文件夹中是否进行了更改 也许我需要创建所有路径的列表 将其放入数组中 并在
  • Ruby 未绑定方法:是否可以强制绑定到其他类的实例?

    我想知道我是否可以强迫这种情况发生 class A def bomb bomb end end class B end bomb A instance method bomb b B new bomb bind b 目前它抛出错误 Type
  • 获取块参数个数

    我需要获取给定块所采用的参数数量 例如 foobar 1 2 3 a b c def foobar x y z block need to obtain number of arguments in block which would be
  • Rails 4 - 如何链接到 PDF 文件(名称.PDF)?

    我正在生成 PDF 文件 我的链接如下所示 当我点击这个时 它会带我去 display invoice 123456789 这是一个 HTML 版本 在控制器中的操作如下 def display invoice if params invo
  • Ruby 中的并行赋值运算符

    我正在查看 Ruby 编程 书中的一个示例 def fib up to max i1 i2 1 1 parallel assignment i1 1 and i2 1 while i1 lt max yield i1 i1 i2 i2 i1
  • 有没有人有 Ruby 和 Rake 的 Notepad++ 函数列表插件的解析规则

    我使用 Notepad 编辑 rake 文件 并且希望能够使用函数列表插件 我无法在线找到任何解析规则 并且 语言解析规则 对话框没有非常清晰的记录 我正在将方法解析到以下列表中 但还想显示任务 Function Begin t def t
  • 在私有控制器方法中返回redirect_to

    前言 我正在使用设备进行身份验证 我试图阻止未经授权的用户查看 编辑或更新其他用户的信息 我最关心的是用户将 DOM 中的表单修改为另一个用户的 ID 填写表单 然后单击更新 我已经专门阅读过 像下面这样的东西应该有效 但事实并非如此 SO
  • 在我的 ramaz 应用程序上显示 £ 符号时,我收到“不兼容的字符编码:CP850 和 UTF-8”

    显示时收到 不兼容的字符编码 CP850 和 UTF 8 我的 ramaz 应用程序上的符号 我怎样才能摆脱这个错误 我的 head 标签中有 UTF 8 元标签 当我输入 用键盘输入符号 看 我已将以下代码放入我的 ruby 文件中 但它
  • 如何在 Rails 4 中使用 params.require

    我有一个像这样的私有方法 用于有四个字段的注册表单 firstname email password and confirm password 我不知道如何检查password confirmation def user params pa
  • Ruby 中的任务/未来

    代表潜在延迟的异步计算并且可以订阅其完成的模式的惯用 Ruby 模拟是什么 即类似于 NET 的东西System Threading Task 或Python 3 xconcurrent futures future 请注意 这并不一定意味
  • REXML - 如何提取单个元素

    我正在用 ruby 编写一些验收测试 其中涉及断言响应 XML 中值的存在 我的 XML 是这样的

随机推荐