美文网首页
安装 mailcatcher 碰到的问题

安装 mailcatcher 碰到的问题

作者: 刘月林Yuelin_MELB | 来源:发表于2018-09-13 21:33 被阅读0次
 liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/Documents/workspace/projekt ⮀ ⭠ master± ⮀ mailcatcher
Starting MailCatcher
==> smtp://127.0.0.1:1025
==> http://127.0.0.1:1080
/Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:531:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:531:in `start_server'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/thin-1.7.2/lib/thin/backends/tcp_server.rb:16:in `connect'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/thin-1.7.2/lib/thin/backends/base.rb:63:in `block in start'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/thin-1.7.2/lib/thin/backends/base.rb:70:in `start'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/thin-1.7.2/lib/thin/server.rb:162:in `start'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/thin-1.7.2/lib/thin/server.rb:148:in `start'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/mailcatcher-0.2.4/lib/mail_catcher.rb:23:in `block in run'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run_machine'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/eventmachine-1.2.7/lib/eventmachine.rb:195:in `run'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/mailcatcher-0.2.4/lib/mail_catcher.rb:21:in `run'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/gems/mailcatcher-0.2.4/bin/mailcatcher:44:in `<top (required)>'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/bin/mailcatcher:23:in `load'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/bin/mailcatcher:23:in `<main>'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `eval'
    from /Users/liuyuelin/.rvm/gems/ruby-2.3.3/bin/ruby_executable_hooks:24:in `<main>'

Gemfile:

source 'https://rubygems.org'

ruby "2.3.3"

git_source(:github) do |repo_name|
  repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
  "https://github.com/#{repo_name}.git"
end


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2', '>= 5.2.1'
# Use Puma as the app server
gem 'puma', '~> 3.7'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'bulma-rails', '~> 0.6.1'
gem 'simple_form', '~> 4.0', '>= 4.0.1'
gem 'devise', '~> 4.4'
gem 'gravatar_image_tag', '~> 1.2'
gem 'jquery-rails', '~> 4.3', '>= 4.3.1'
gem "wysiwyg-rails"
gem 'public_activity', '~> 1.5'
gem 'sqlite3'
gem 'mailcatcher' 
gem 'pg'
gem "figaro"

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '~> 2.13'
  gem 'selenium-webdriver'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'better_errors', '~> 2.4'
  gem 'guard', '~> 2.14', '>= 2.14.1'
  gem 'guard-livereload', '~> 2.5', '>= 2.5.2'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

Development.rb:

Rails.application.configure do
  # Verifies that versions and hashed value of the package contents in the project's package.json
  config.webpacker.check_yarn_integrity = true
  # Settings specified here will take precedence over those in config/application.rb.

  # In the development environment your application's code is reloaded on
  # every request. This slows down response time but is perfect for development
  # since you don't have to restart the web server when you make code changes.
  config.cache_classes = false

  # Do not eager load code on boot.
  config.eager_load = false

  # Show full error reports.
  config.consider_all_requests_local = true

  # Enable/disable caching. By default caching is disabled.
  # Run rails dev:cache to toggle caching.
  if Rails.root.join('tmp', 'caching-dev.txt').exist?
    config.action_controller.perform_caching = true

    config.cache_store = :memory_store
    config.public_file_server.headers = {
      'Cache-Control' => "public, max-age=#{2.days.to_i}"
    }
  else
    config.action_controller.perform_caching = false

    config.cache_store = :null_store
  end

  # Store uploaded files on the local file system (see config/storage.yml for options)
  config.active_storage.service = :local

  # Don't care if the mailer can't send.
  config.action_mailer.raise_delivery_errors = false

  config.action_mailer.perform_caching = false

  # Print deprecation notices to the Rails logger.
  config.active_support.deprecation = :log

  # Raise an error on page load if there are pending migrations.
  config.active_record.migration_error = :page_load

  # Highlight code that triggered database queries in logs.
  config.active_record.verbose_query_logs = true

  # Debug mode disables concatenation and preprocessing of assets.
  # This option may cause significant delays in view rendering with a large
  # number of complex assets.
  config.assets.debug = true

  # Suppress logger output for asset requests.
  config.assets.quiet = true

  # Raises error for missing translations
  # config.action_view.raise_on_missing_translations = true

  # Use an evented file watcher to asynchronously detect changes in source code,
  # routes, locales, etc. This feature depends on the listen gem.
  # mailercatcher
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
  # devise 
  config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
  config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end

刘月林
写于浙江宁波
2018/09/13

相关文章

网友评论

      本文标题:安装 mailcatcher 碰到的问题

      本文链接:https://www.haomeiwen.com/subject/ayiggftx.html