【问题标题】:RAILS: Unable to install daemon pluginRAILS:无法安装守护程序插件
【发布时间】:2015-10-06 05:36:28
【问题描述】:

守护程序插件: https://github.com/dougal/daemon_generator

当我这样做时

rails plugin install git://github.com/dougal/daemon_generator.git

我得到这个输出:

Usage:
  rails plugin new APP_PATH [options]

Options:
  -r, [--ruby=PATH]                                      # Path to the Ruby binary of your choice
                                                         # Default: /home/nicki/.rbenv/versions/2.2.2/bin/ruby
  -m, [--template=TEMPLATE]                              # Path to some plugin template (can be a filesystem path or URL)
      [--skip-gemfile], [--no-skip-gemfile]              # Don't create a Gemfile
  -B, [--skip-bundle], [--no-skip-bundle]                # Don't run bundle install
  -G, [--skip-git], [--no-skip-git]                      # Skip .gitignore file
      [--skip-keeps], [--no-skip-keeps]                  # Skip source control .keep files
  -O, [--skip-active-record], [--no-skip-active-record]  # Skip Active Record files
  -S, [--skip-sprockets], [--no-skip-sprockets]          # Skip Sprockets files
      [--skip-spring], [--no-skip-spring]                # Don't install Spring application preloader
  -d, [--database=DATABASE]                              # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
                                                         # Default: sqlite3
  -j, [--javascript=JAVASCRIPT]                          # Preconfigure for selected JavaScript library
                                                         # Default: jquery
  -J, [--skip-javascript], [--no-skip-javascript]        # Skip JavaScript files
      [--dev], [--no-dev]                                # Setup the plugin with Gemfile pointing to your Rails checkout
      [--edge], [--no-edge]                              # Setup the plugin with Gemfile pointing to Rails repository
      [--skip-turbolinks], [--no-skip-turbolinks]        # Skip turbolinks gem
  -T, [--skip-test-unit], [--no-skip-test-unit]          # Skip Test::Unit files
      [--rc=RC]                                          # Path to file containing extra configuration options for rails command
      [--no-rc], [--no-no-rc]                            # Skip loading of extra configuration options from .railsrc file
      [--dummy-path=DUMMY_PATH]                          # Create dummy application at given path
                                                         # Default: test/dummy
      [--full], [--no-full]                              # Generate a rails engine with bundled Rails application for testing
      [--mountable], [--no-mountable]                    # Generate mountable isolated application
      [--skip-gemspec], [--no-skip-gemspec]              # Skip gemspec file
      [--skip-gemfile-entry], [--no-skip-gemfile-entry]  # If creating plugin in application's directory skip adding entry to Gemfile

Runtime options:
  -f, [--force]                    # Overwrite files that already exist
  -p, [--pretend], [--no-pretend]  # Run but do not make any changes
  -q, [--quiet], [--no-quiet]      # Suppress status output
  -s, [--skip], [--no-skip]        # Skip files that already exist

Rails options:
  -h, [--help], [--no-help]  # Show this help message and quit

Description:
    The 'rails plugin new' command creates a skeleton for developing any
    kind of Rails extension with ability to run tests using dummy Rails
    application.

Example:
    rails plugin new ~/Code/Ruby/blog

    This generates a skeletal Rails plugin in ~/Code/Ruby/blog.
    See the README in the newly created plugin to get going.

我不知道为什么会发生这种情况,我尝试在 rails 应用程序内部和外部执行此操作,但没有运气!还是一样。 我正在使用 Rails 4.2.3

我也试过这样做:

rails plugin new install git://github.com/dougal/daemon_generator.git

它创建了一些文件。 创建

      create  README.rdoc
      create  Rakefile
      create  install.gemspec
      create  MIT-LICENSE
      create  .gitignore
      create  Gemfile
      create  lib/install.rb
      create  lib/tasks/install_tasks.rake
      create  lib/install/version.rb
      create  test/test_helper.rb
      create  test/install_test.rb
      append  Rakefile
  vendor_app  test/dummy
         run  bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies........
Using rake 10.4.2
Installing i18n 0.7.0
Installing json 1.8.3 with native extensions
Installing minitest 5.8.1
Installing thread_safe 0.3.5
Installing tzinfo 1.2.2
Installing activesupport 4.2.4
Installing builder 3.2.2
Installing erubis 2.7.0
Installing mini_portile 0.6.2
Installing nokogiri 1.6.6.2 with native extensions
Installing rails-deprecated_sanitizer 1.0.3
Installing rails-dom-testing 1.0.7
Installing loofah 2.0.3
Installing rails-html-sanitizer 1.0.2
Installing actionview 4.2.4
Installing rack 1.6.4
Installing rack-test 0.6.3
Installing actionpack 4.2.4
Installing globalid 0.3.6
Installing activejob 4.2.4
Installing mime-types 2.6.2
Installing mail 2.6.3
Installing actionmailer 4.2.4
Installing activemodel 4.2.4
Installing arel 6.0.3
Installing activerecord 4.2.4
Using bundler 1.10.6
Installing thor 0.19.1
Installing railties 4.2.4
Installing sprockets 3.4.0
Installing sprockets-rails 2.3.3
Installing rails 4.2.4
Using install 0.0.1 from source at .
Installing sqlite3 1.3.10 with native extensions
Bundle complete! 2 Gemfile dependencies, 35 gems now installed.
Bundled gems are installed into ./vendor/bundle.

然后我用这个命令测试了

rails generate daemon test

我得到了这个错误:

Could not find generator 'daemon'. Maybe you meant 'job', 'mailer' or 'task'
Run `rails generate --help` for more options.

我无法为 rails 安装守护进程。

当我这样做时:

./script/generate daemon testdaemon

我收到此错误:

zsh: no such file or directory: ./script/generate

即使我有脚本文件夹。

【问题讨论】:

  • 最后一次提交是 > 5 年前,问题表明它不适用于 rails 3.x,大多数人说他们只是安装 gem,然后直接使用它,
  • 我已将 gem 放入 gemfile.. 不知道出了什么问题,我也手动安装了 sudo gem install daemons 但仍然没有运气

标签: ruby-on-rails daemon


【解决方案1】:

不再存在用于 Rails 的插件。为 Rails 2(或 3)编写的任何内容都不太可能与 4 或即将发布的版本 5 一起使用。

您可以尝试将代码签入 lib/ 并从 config/application 中获取文件。

【讨论】:

  • 你能告诉我守护进程和sidekiq的区别吗,如果我使用sidekiq,我需要安装守护进程吗?
  • 只需使用sidekiq,在此处查看所有cmets:stackoverflow.com/questions/15520676/… 或许多其他相关问题!
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-05
  • 1970-01-01
  • 2011-04-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多