rack

Cryptic error when trying to run POW

倾然丶 夕夏残阳落幕 提交于 2020-01-15 02:35:26
问题 I am having a rather weird error message when running POW for my rails app. I followed the instructions: - cd ~/.pow - ln -s /Users/mingyeow/Dailymuses-Server-Side And got this: Error starting application Your Rack app raised an exception when Pow tried to run it. Error: '/Users/mingyeow/Dailymuses-Server-Side/.powrc' failed to load: true && source '/Users/mingyeow/Dailymuses-Server-Side/.powrc' > /dev/null && env > '/var/folders/cl/fd2wt82149x9trkxmsvqrt500000gn/T/pow.18625.1358760244196

Is this a bug in Rack?

纵饮孤独 提交于 2020-01-14 14:27:08
问题 I'm trying to post multipart content (a file and some strings) to a Sinatra server on localhost using a java client. It seems the server doesn't like the POST message. The stack trace is: ERROR NoMethodError: undefined method `rewind' for "hi":String D:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/utils.rb:581:in`block in parse_multipart' D:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/utils.rb:499:in`loop' D:/Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.3/lib/rack/utils.rb:499

What's wrong with my rackup file?

≯℡__Kan透↙ 提交于 2020-01-13 09:47:10
问题 When i attempt to start my unicorn server I've got the next stack trace: Can't understand what's wrong with rackup file? Why it is not readable? sites@bck:~/fatfreecrm$ /home/sites/.rvm/gems/ruby-1.9.2-p180@fatfreecrm/bin/unicorn_rails -E -D production -c /home/sites/fatfreecrm/config/unicorn.rb /home/sites/.rvm/gems/ruby-1.9.2-p180@fatfreecrm/gems/unicorn-3.7.0/lib/unicorn/configurator.rb:600:in `parse_rackup_file': rackup file (production) not readable (ArgumentError) from /home/sites/.rvm

Where to insert Rack::Deflater in the rack?

邮差的信 提交于 2020-01-11 23:07:13
问题 I currently have the following: use Rack::Rewrite use Rack::Cache, {:verbose=>true, :metastore=>"memcached://localhost:11211/rack-cache/meta", :entitystore=>"memcached://localhost:11211/rack-cache/body"} use Rack::Rewrite use Rack::Lock use Rack::Deflater use ActionController::Failsafe use #<Class:0x007fb34be9ac90> use ActionController::Session::DalliStore, #<Proc:0x007fb34bea3638@(eval):8 (lambda)> use Rails::Rack::Metal use ActionController::ParamsParser use Rack::MethodOverride use Rack:

use some Middleware only for specific Rack website

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-11 14:12:11
问题 I have a Rack server where I run multiple websites. use Rack::Session::Cookie app = lambda do |env| case # Kek Mobile when env['HTTP_HOST'] =~ /mobi.kek.com/ require ::File.expand_path(::File.join(::File.dirname(__FILE__),'code','kek_mobile','main.rb')) selectedApp = KekMobile.new # Kek Facebook App when env['HTTP_HOST'] =~ /fb.kek.com/ require ::File.expand_path(::File.join(::File.dirname(__FILE__),'code','facebook','main.rb')) selectedApp = Facebook.new else #we launch the corp website

Execute Rack Middleware for Specific Routes in Rails [duplicate]

自闭症网瘾萝莉.ら 提交于 2020-01-11 12:05:20
问题 This question already has answers here : Trigger Rack middleware on specific Rails routes (3 answers) Closed 4 years ago . I'm integrating a 3rd party API, and at one step they post JSON data into our server. The content type is application/json , but the payload is actually gzipped. Due to the content type, rails is throwing an ActionDispatch::ParamsParser::ParseError exception when trying to parse the data. I plan to write a rack middleware to catch the exception and try and uncompress the

How to decode a cookie from the header of a websocket connection handshake? (Ruby)

穿精又带淫゛_ 提交于 2020-01-10 04:14:27
问题 I am running a Sinatra app within an EventMachine.run loop and in my ws.onopen method I wish to check the handshake header's cookie to ensure that the incoming request is coming from a registered user of my webapp. My Sinatra app includes the following: use Rack::Session::Cookie, :key => COOKIE_KEY, :path => '/', :expire_after => 2592000, #30 days :secret => COOKIE_SECRET and my ws.onopen method looks like this (trimmed) ws.onopen { |handshake| cookie, bakesale = handshake.headers['Cookie']

How to properly mount github's gollum wiki inside a Rails App?

亡梦爱人 提交于 2020-01-09 19:31:50
问题 I'm trying to provide a gollum based wiki for my app by mounting it as a rack application inside my routes.rb file: require 'gollum/frontend/app' #Gollun config gollum_path = Rails.root Precious::App.set(:gollum_path, gollum_path) Precious::App.set(:wiki_options, {:universal_toc => false}) TestWiki::Application.routes.draw do mount Precious::App, :at => "wiki" end The wiki is supposed to run at '/wiki' but everytime a go to this url it redirects me to /wiki/create/Home , and after a create a

rails bluehost error Ruby (Rack) application could not be started

∥☆過路亽.° 提交于 2020-01-06 07:58:06
问题 I've worked through many issues deploying a simple rails app and thought all was good when i saw the rails welcome screen... then I saw lots of errors when I selected the "about your applications environment" link of the default rails page. The errors are below and also appear when I go to specific URLs. I THINK the issue is that my ~/.bashrc file is explicitly calling for export GEM_PATH=$GEM_HOME:/usr/lib64/ruby/gems/1.8 when the errors reference gems/1.9.3 I'm just not sure if this is the

URL Map an entire namespace using rack mount?

梦想的初衷 提交于 2020-01-06 03:57:27
问题 I have two modular Sinatra rack based applications: core.rb & project.rb : # core.rb class Core < Sinatra::Base get "/" do "Hello, world!" end end # project.rb class Project < Sinatra::Base get "/" do "A snazzy little Sinatra project I wish to showcase." end get "/foo" do "If you see this, congratulations." end end My goal is simply to map the entire /projects namespace to the Project class, wheras everything else is handled by the Core class. I found that you can do this to a limited extent