webrick

I'm confused: 'rails -v' and 'gem list' show different versions

强颜欢笑 提交于 2020-01-06 01:36:10
问题 I've made a fresh installation of Ruby on Rails on my Windows 7 machine (using RailsInstaller) after a failed attempt to follow Michael Hartl's Ruby on Rails Tutorial (if you're interested, see my previous question pertaining to the said fail). As I thought my previous fail had something to do with my inept attempt at installing different gem versions hoping to replicate requirements laid out in the tutorial, I decided to check the version of rails gem immediately after the install. When I

Can I make Rails / WEBrick recognize entries in /etc/hosts as subdomains (instead of domains)?

筅森魡賤 提交于 2020-01-05 18:30:09
问题 I'm trying to use subdomains locally for a Rails app so I added the following line to my /etc/hosts file: # add 'test' subdomain for localhost 127.0.0.1 test.localhost Now I can point my browser to test.localhost:3000 and it hits my Rails app. However, Rails or WEBrick interprets the whole darn thang as the domain: # logging in the controller logger.debug("domain: '#{request.domain}', subdomain: '#{request.subdomain}'") # output in the console domain: 'test.localhost', subdomain: '' Is there

Webrick transparent proxy

此生再无相见时 提交于 2020-01-01 19:54:13
问题 I've a absolute simple proxy running. require 'webrick' require 'webrick/httpproxy' s = WEBrick::HTTPProxyServer.new(:Port => 8080, :RequestCallback => Proc.new{|req,res| puts req.request_line, req.raw_header}) # Shutdown functionality trap("INT"){s.shutdown} # run the beast s.start This should in my mind not influence the communication in any way. But some sites doesn't work any more. Specially http://lastfm.de 's embedded flash players doesn't work. The header looks link: - -> http://ext

rails mysql gem problem on ubuntu

混江龙づ霸主 提交于 2020-01-01 12:46:09
问题 Ruby on Rails: I would like to call a controller on the localhost, but the server said !!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1' The problem ? When I hit 'gem list' command then I got a list witch is containing the mysql 2.8.1 . So the gem is INSTALLED ! WHY can't it see by the webrick ? Thank you. 回答1: You need to add the line gem 'mysql', '2.8.1' to your Gemfile. Then type bundle install in the root folder of your Rails project. It sounds like you forgot to run

cant do port forwarding ro my webrick server to access it from the net!

為{幸葍}努か 提交于 2019-12-31 04:11:31
问题 i am developing a facebook app and i am using for that facebooker plugin and webrick server. i have configured correctly my router to froward ports to my machine for 2 ports (80 and 3000) the apache server can be accessed from the net http://ip:80 amd the webrick server can http://ip:3000 , i dont understand why , please help me. 回答1: What IP address do you have WEBrick set to listen on? My guess is it could be set to “127.0.0.1” which would cause the problem you’re describing. If so, set it

Configure WEBrick to use automatically generated self-signed SSL/HTTPS certificate

孤街醉人 提交于 2019-12-30 03:59:07
问题 I want to develop my Ruby on Rails application locally with SSL/HTTPS, but I'm having trouble trying to setup a server to use SSL. The following are the things I've already tried so far: rails server [options] The rails server command doesn't come with an ssl option ( rails server --help ): Usage: rails server [mongrel, thin, etc] [options] -p, --port=port Runs Rails on the specified port. Default: 3000 -b, --binding=ip Binds Rails to the specified ip. Default: 0.0.0.0 -c, --config=file Use

Changing the base URL for Rails 3 development

若如初见. 提交于 2019-12-28 02:39:14
问题 I know I'm going to deploy to an environment with my application running with a base URL which looks like this: http://someserver/mydepartment/myapp My development environment is set up to use the default Rails configuration, which looks like this: http://localhost:3000/myapp I'd like to model this deployment path in my development environment. That is, I'd like to develop with a base URL which looks like this: http://localhost:3000/mydepartment/myapp That way, I can make all my URLs relative

unable to start the rails server

做~自己de王妃 提交于 2019-12-25 05:14:52
问题 When I try to start my rails server i get this error C:/Ruby187/lib/ruby /gems/1.8/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.8/mysql 2.so: 193: %1 is not a valid Win32 application. - C:/Ruby187/lib/ruby/gems/1.8 /gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.8/mysql2.so (LoadError) Tried changing the libmysql.dll file even then it doesn't work. 回答1: The problem is with mysql. It is a 64 bit installation. Change it to 32bit and it runs fine. 来源: https://stackoverflow.com/questions/10493487

Why does this rackup file work with Thin, but not WEBrick or Unicorn?

一世执手 提交于 2019-12-25 02:19:42
问题 I am having a strange issue running my static website locally (for testing). Both WEBrick and Unicorn are causing an assertion failure in Rack when navigating to root. However Thin works perfectly. My rackup file 'config.ru': # This is the root of our app @root = File.expand_path(File.dirname(__FILE__)) + '/site' default_charset = "; charset=UTF-8" run Proc.new { |env| # Extract the requested path from the request path = Rack::Utils.unescape(env['PATH_INFO']) index_file = @root + "#{path}

Setting up the Webrick to serve to internet my rails app

大城市里の小女人 提交于 2019-12-23 04:36:21
问题 I try to host my ruby on rails app in my computer in Ubuntu but I cannot get it. I try to port forward from my router settings. I think I successfully forward the ports a source ports 80 - 8080 and destination port 3000. Then I start webrick in production mode. However, I could not open my app from internet by typing my external IP. How can I set my computer in proper way? Do you have any suggestions? Thanks... 回答1: Try the following to help debug the issue: From the same machine (you can use