webrick

Connect to a locally built Jekyll Server using mobile devices in the LAN

自古美人都是妖i 提交于 2019-11-27 19:46:48
问题 After using jekyll serve on one machine, a WEBrick server is set up and the site can be accessed from localhost:4000 on this particular PC. However, I'm wondering how to access this web server from other machines in the LAN, especially for mobile devices? I'm trying to test the jekyll site on mobile devices before pushing the code to Github. 回答1: Try jekyll serve --host=0.0.0.0 when you invoke Jekyll on the command line. That will make Jekyll's HTTP server bind to all available IPs, rather

Server is already running in Rails

橙三吉。 提交于 2019-11-27 16:45:48
When I am starting rails server using rails s command it is showing A server is already running. Check C:/Sites/folder/Pids/Server.pids When I open the file it is outputting a 4 digit number only so how could I resolve this issue ? FYI No other instance of Rails cmd is running this time. Checked Task manager but only cmd.exe is showing no else process is running. (using Windows). rainkinz Remove the file: C:/Sites/folder/Pids/Server.pids Taimoor Changaiz Old Solution: rails s -p 4000 -P tmp/pids/server2.pid Also you can find this post for more options Rails Update to 3.2.11 breaks running

We're sorry, but something went wrong. - with Rails, Apache, Passenger

余生颓废 提交于 2019-11-27 13:49:59
问题 I have Rails 3.2.3 with Apache and Passenger . I have a project working in development mode. When I switch the project to production mode ( Passenger standard) it gives me an HTTP Error 500 : We're sorry, but something went wrong. This happens even with WEBrick . Can somebody help me? Edit : My production environment file: http://pastebin.com/ZAudSzkc 回答1: Make sure you have ran $ bundle install . If this doesn't succeed, go to your production environment and connect to your server using ssh

How to set access-control-allow-origin in webrick under rails?

自闭症网瘾萝莉.ら 提交于 2019-11-27 11:28:15
I have written a small rails app to serve up content to another site via xmlhttprequests that will be operating from another domain (it will not be possible to get them running on the same server). I understand I will need to set access-control-allow-origin on my rails server to allow the requesting web page to access this material. It seems fairly well documented how to do this with Apache and this is probably the server I will use once I deploy the site. While I am developing though I hope to just use webrick as I am used to doing with rails. Is there a way of configuring webrick to provide

Ruby Sinatra Webservice running on localhost:4567 but not on IP

人盡茶涼 提交于 2019-11-27 11:09:12
问题 I have a ruby(using sinatra) webservice on windows 7 32 bit OS. Its running on port 4567. Its working fine when I use localhost:4567 but when I replace localhost with the local ip of my machine say, 192.168.103.99:4567 it doesn't work, and fails to connect. I have already disabled the firewall, by-pass proxy and added port 4567 to exception, still no luck. What might be the issue ? 回答1: From the comment of @SudarshanShubakar following worked for me. ruby app.rb -o 0.0.0.0 回答2: When using the

Why does Ruby on Rails use http://0.0.0.0:3000 instead of http://localhost:3000?

非 Y 不嫁゛ 提交于 2019-11-27 10:16:02
问题 I am very new to Ruby on Rails so when I tried to follow the official " Getting Started " ruby on rails tutorial, I was a bit disappointed because it went wrong very quickly. Basically it said : …navigate to http://localhost:3000. You should see Rails’ default information page. But when I follow the instructions, I get => Rails 2.3.4 application starting on http://0.0.0.0:3000 After trying both addresses, I know that they point to the same thing, but can someone explain to me why Ruby on

Changing the base URL for Rails 3 development

拈花ヽ惹草 提交于 2019-11-27 07:08:33
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 to "/" and they will work in both environments. How can I change it so my application will live at

How to use deactivate Webrick's SSL

房东的猫 提交于 2019-11-27 01:35:42
问题 Last week I tried to debug with SSL activated in webbrick, but I forget how to restore the settings to default(without SSL). Every time I visit a controller, now it shows: SSL connection error Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have. Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error. And below is the log from the console, can anyone help? [2011-05-10 07:28

Configuring WEBrick to use SSL in Rails 4

北城以北 提交于 2019-11-27 00:56:58
问题 I have a Rails App that I want to deploy on SharePoint 2013. In order to achieve some means of authentication, I need the WEBrick server to serve ssl https and listen to incoming https on port https://localhost:3001 . Unfortunately, I am not very experienced with configuring the server. I've have only found some outdated tutorials for older Rails version, that don't seem to do the job anymore. Any tips are greatly appreciated. 回答1: I know you asked for WEBrick, and excuse me for suggesting

How to change default port of a Rails 4 app?

徘徊边缘 提交于 2019-11-27 00:37:12
问题 I know that I can start a rails server on another port via -p option. But I'd like to setup another port per application as long as I start webrick. Any ideas? Regards Felix 回答1: Quick solution: Append to Rakefile task :server do `bundle exec rails s -p 8080` end Then run rake server 回答2: Append this to config/boot.rb : require 'rails/commands/server' module DefaultOptions def default_options super.merge!(Port: 3001) end end Rails::Server.send(:prepend, DefaultOptions) Note: ruby >= 2.0