我在办公室使用代理脚本连接到互联网.结果我的命令提示符(Win XP)没有连接,我只能使用浏览器访问网络.
有没有我可以手动安装一些我需要的红宝石 - 不使用
gem install 'abc'
Run Code Online (Sandbox Code Playgroud)
或者有没有办法让我的命令提示符连接到互联网.虽然我的IE设置确实使用了脚本,但我仍然无法让CMD连接.
我一直在我的本地Windows机器上试用Sinatra.我想要包含一些本地CSS和JS文件.这是代码在layout.erb中的样子
<script src="jquery.js" type="text/javascript">
</script>
<link rel="stylesheet" href="reset.css" type="text/css" />
Run Code Online (Sandbox Code Playgroud)
我的所有文件都与app.rb位于同一个文件夹中
这是我的app.rb
require 'rubygems'
require 'sinatra'
get '/' do
erb :index
end
Run Code Online (Sandbox Code Playgroud)
出于某种原因,我无法看到这些文件包含在我的页面中.当我查看源代码并单击文件(JS/CSS)时,我看到 - "Sinatra不知道这个小曲" - 错误.
我在这做错了什么?
如何编写自定义命令以在Windows命令提示符下使用Notepad ++文本编辑器打开文件.
例如.
C:\Sites>ntp abc.txt
Run Code Online (Sandbox Code Playgroud)
在Notepad ++中打开文件abc.txt
这是我的spec文件的样子: spec/api/v1/projects_spec.rb
require "spec_helper"
describe "/api/v1/projects", :type => :api do
context "projects viewable by this user" do
it "JSON" do
end
end
end
Run Code Online (Sandbox Code Playgroud)
它包含了更多,但我删除了很多行,但未成功尝试查找错误,如下所示:
Failure/Error: Unable to find matching line from backtrace
NoMethodError: undefined method `env' for nil:NilClass
Run Code Online (Sandbox Code Playgroud)
这段代码来自Ryan Bigg的"Rails 3 in Action".它包含的唯一其他文件是:spec/support/api/helper.rb
module ApiHelper
include Rack::Test::Methods
def app
Rails.application
end
end
RSpec.configure do |c|
c.include ApiHelper, :type => :api
end
Run Code Online (Sandbox Code Playgroud)
我一直在尝试谷歌过去1小时的错误,我发现最接近的是这个,因此我删除了使用Devise :: Test_Helpers的代码.可悲的是,它仍然无法正常工作.
任何帮助,将不胜感激.非常感谢.
# /home/prakhar/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/test_helpers.rb:24:in `setup_controller_for_warden'
# /home/prakhar/.rvm/gems/ruby-1.9.2-p290/gems/rspec-rails-2.8.1/lib/rspec/rails/adapters.rb:15:in `block (2 levels) in setup'
# …Run Code Online (Sandbox Code Playgroud) 在我尝试让我的烧瓶应用程序在Apache上运行后反复失败后,我mod_wsgi决定尝试运行hello world示例.这是我的 -
目录结构(我将apache默认更改/var/www为~/public_html)
- public_html
- wsgi-scripts
- test_wsgi.wsgi
- test_wsgi
- test_wsgi.wsgi
Run Code Online (Sandbox Code Playgroud)
test_wsgi.wsgi文件
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
Run Code Online (Sandbox Code Playgroud)
VirtualHost配置文件(称为testwsgi) - 驻留在 /etc/apache2/sites-enabled/
<VirtualHost *:80>
DocumentRoot ~/public_html/test_wsgi
<Directory ~/public_html/test_wsgi>
Order allow,deny
Allow from all
</Directory>
WSGIScriptAlias /wsgi ~/public_html/wsgi-scripts/test_wsgi.wsgi
<Directory ~/public_html/wsgi-scripts>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)
当我尝试localhost/wsgi使用浏览器时,我收到404 Not Found错误.我究竟做错了什么?这是我第一次尝试在生产服务器上部署应用程序.到目前为止,我采用了简单的方法来使用Google App Engine.我无法继续部署我的烧瓶应用程序,直到它启动并运行.非常感谢!
我在Windows XP上,我刚刚安装了GVim 7.3.如何制作默认编辑器?如何使用命令提示符运行它,例如
c:\Windows>gvim boot.ini
Run Code Online (Sandbox Code Playgroud)
在gvim中打开此文件.
非常感谢
这是第n次,我正在尝试连接到我的github帐户,并且在我未能做到这一点时变得越来越令人沮丧.
我在Windows上逐步遵循本教程Github设置,但我在第5步失败了,即测试一切.
ssh git@github.com
Run Code Online (Sandbox Code Playgroud)
给了我这个
ssh: github.com: no address associated with name
Run Code Online (Sandbox Code Playgroud)
有什么想法有什么不对?任何帮助将不胜感激.
我正在使用Windows XP上的railsinstaller附带的默认git安装(在代理后面)
我正在尝试设置我的VIMRC(在Ubuntu 11.10上的gvim)文件,其中只包含2行(截至目前)
set ruler
set number
Run Code Online (Sandbox Code Playgroud)
我一直收到这个错误:
line 1:
E488: Trailing characters: number^M
line 2:
E488: Trailing characters: ruler^M
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
我正在flask-sqlalchemy构建一个webapp,我有以下模型:
class Post(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), unique=True)
candidates = db.relationship('Candidate', backref='post', lazy='dynamic')
def __init__(self, name):
self.name = name
def __repr__(self):
return "<Post %r>" % self.name
class Candidate(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(80), primary_key=True)
post_id = db.Column(db.Integer, db.ForeignKey('post.id'))
hostel = db.Column(db.String(80))
yes_no = db.Column(db.Boolean)
#votes = db.relationship('Vote', backref='vote', lazy="dynamic")
def __init__(self, name, hostel, post_id, yes_no):
self.name = name
self.hostel = hostel
self.post_id = post_id
self.yes_no = yes_no
def __repr__(self):
return "<Candidate: %r, Post: …Run Code Online (Sandbox Code Playgroud) 一位朋友让我看看Wefeelfine,看到这个概念和执行,我只是大吃一惊.我进一步观察并浏览了无数的数据可视化示例,其中每一个都很酷,至少可以说.
我在家里,目前没什么有趣的.任何人都可以给我一些指示,我可以从哪里开始学习数据可视化.任何书籍,博客或其他资源都会很棒.
谢谢.