Tag: 服务器

Capistrano不会创建puma.pid文件

我使用Capistrano来部署我的Rails应用程序。 但是,当我部署我的应用程序时,没有创建puma.pid文件,这会导致问题 – 我无法重新启动服务器或使用capistrano部署新版本 – capistrano无法停止puma ,因为puma.pid不会出现问题并假设没有puma进程正在运行。 当capistrano尝试运行另一个版本的puma时,我得到ADDRESS ALREADY IN USE错误。 这是我的deploy.rb lock ‘3.4.0’ set :application, ‘appname’ set :repo_url, ‘giturl’ set :deploy_to, ‘/home/user/appname’ set :pty, false set :linked_files, %w(config/application.yml config/database.yml) set :linked_dirs, %w(log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads) set :keep_releases, 5 set :rvm_type, :user set :rvm_ruby_version, ‘2.3.0’ set :puma_rackup, -> { File.join(current_path, ‘config.ru’) } […]

无法运行rails服务器:`require’:无法加载此类文件–net / ssh(LoadError)

我正在尝试使用michael hartl指南在轨道上学习ruby。 在过去,我能够完成新的rails webapp的设置。 现在,当我尝试运行服务器时,我收到此错误: /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent/compute.rb:3:in `require’: cannot load such file — net/ssh (LoadError) from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent/compute.rb:3:in `’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent.rb:1:in `require’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog/joyent.rb:1:in `’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog.rb:41:in `require’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/fog-1.26.0/lib/fog.rb:41:in `’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `require’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage/fog.rb:3:in `’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `require’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave/storage.rb:9:in `’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `require’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/carrierwave-0.10.0/lib/carrierwave.rb:78:in `’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `require’ from /home/ss/.rvm/gems/ruby-2.2.2/gems/bundler-1.10.6/lib/bundler/runtime.rb:76:in `block (2 levels) […]

Rails服务器保持退出(SocketError)

Rails noob在这里。 我正在尝试使用Michael Hartl的Ruby on Rails教程,但每次运行rails服务器时,它都会保留Exiting并向我显示SocketError。 上周末,我能够使用来自初创公司的wifi运行服务器,所以我猜它与我的互联网连接/防火墙有关? 我今天下午也遇到了与图书馆服务器相同的问题。 任何帮助表示赞赏! 提前致谢。 => Booting WEBrick => Rails 4.2.0 application starting in development on http://localhost:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2015-02-23 22:33:11] INFO WEBrick 1.3.1 [2015-02-23 22:33:11] INFO ruby 2.2.0 (2014-12-25) [x86_64-darwin14] Exiting /Users/awo/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/socket.rb:232:in `getaddrinfo’: getaddrinfo: nodename nor servname […]

将Rails服务器绑定到0.0.0.0的内容是什么?

我使用“www.xip.io”作为DNS通配符在不同设备上进行测试。 我将主域名设置为我的IP地址。 我用bundle exec rails server启动了一个rails服务器,然后我去了www..xip.io:3000并注意我的rails服务器没有响应。 但是,如果我将我的rails服务器绑定到0.0.0.0,就像bundle exec rails server -b 0.0.0.0 ,它可以工作! 我不明白0.0.0.0告诉我的服务器这是什么工作。 有人能理解这个吗?

无法启动Rails

我更新了Rails和Ruby: $ ruby -v ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0] $ rails -v Rails 4.1.8 现在,当我执行rails server我得到了这个: $ rails server Usage: rails new APP_PATH [options] Options: -r, [–ruby=PATH] # Path to the Ruby binary of your choice # Default: /Users/guilherme/.rbenv/versions/2.1.5/bin/ruby -m, [–template=TEMPLATE] # Path to some application template (can be a filesystem path or URL) […]

服务器Ruby on Rails + unicorn + nginx停止响应

我的服务器Rails工作正常,但在没有请求的10分钟后,它的响应是一个糟糕的网关。 我真的认为我的配置是有序的,但它不起作用。 我没有更多的想法发生了什么。 我的配置: unicorn.rb: @dir = File.expand_path(File.dirname(__FILE__)) + “/..” worker_processes 2 working_directory @dir timeout 10 listen File.join(‘/tmp/nutrimais.sock’) listen File.join(‘/tmp/nutrimais_2.sock’) preload_app true# if ENV[‘RAILS_ENV’] != ‘development’ GC.respond_to?(:copy_on_write_friendly=) and GC.copy_on_write_friendly = true check_client_connection false before_fork do |server, worker| Signal.trap ‘TERM’ do puts ‘Unicorn master intercepting TERM and sending myself QUIT instead’ Process.kill ‘QUIT’, Process.pid end defined?(ActiveRecord::Base) […]

Rails服务器正在运行,但无法连接/ ping / telnet到localhost

我正在研究ubuntu 15.04(它不是VM)。 我安装了rails,ruby和bundler。 当我启动服务器时,一切似乎工作正常,因为我得到了这个: sudo rails s -p 8080 Warning: Running `gem pristine –all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle –path) will improve the startup performance of Spring. => Booting WEBrick => Rails 4.2.5.2 application starting in development on http://localhost:8080 => Run `rails server -h` for […]

在Windows 7上运行jekyll服务器时出错

我正在尝试在我的本地机器上运行Jekyll服务器,所以当我在终端中运行jekyll server时,返回fallowing消息: $ jekyll serve Configuration file: C:/xxx/Site/_config.yml Source: C:/xxx/Site Destination: C:/xxx/Site/_site Generating… c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/posix-spawn-0.3.11/lib/posix/spawn.rb:164: warning: cannot close fd before spawn ‘which’ não é reconhecido como um comando interno ou externo, um programa operável ou um arquivo em lotes. Liquid Exception: No such file or directory – python c:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/pygments.rb-0.6.0/lib/pygments/mentos.py in _posts/2015-06-02-welcome-to-j ekyll.markdown done. Please add the […]

当我加载localhost时,Rails服务器出错:3000

所以,我已开始在rails上学习ruby,我使用以下命令创建一个ROR项目: rails new blog 接下来我编写以下命令来运行rails服务器: rails s Rails服务器运行,我在Web浏览器中加载localhost:3000 ; 但我在网络浏览器上得到500 internal error 。 日志文件有以下错误: ArgumentError (wrong number of arguments (2 for 1)): actionpack (4.2.2) lib/action_dispatch/http/request.rb:338:in `parse_query’ rack (1.6.3) lib/rack/request.rb:191:in `GET’ actionpack (4.2.2) lib/action_dispatch/http/request.rb:300:in `GET’ actionpack (4.2.2) lib/action_dispatch/http/parameters.rb:14:in `parameters’ actionpack (4.2.2) lib/action_dispatch/http/filter_parameters.rb:37:in `filtered_parameters’ actionpack (4.2.2) lib/action_controller/metal/instrumentation.rb:22:in `process_action’ actionpack (4.2.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action’ activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action’ actionpack […]