当我尝试使用RubyMine IDE安装ruby-debug-base19x gem来调试我的应用程序时,我收到了以下错误消息,有人可以帮助我吗?
我正在使用Mac OS X 10.7.4
/Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
/Users/danilobarsotti/.rvm/gems/ruby-1.9.3-p194/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for insns.inc... yes
checking for insns_info.inc... yes
checking for eval_intern.h... yes
creating Makefile
make
compiling breakpoint.c
compiling ruby_debug.c
ruby_debug.c:24: error: conflicting types for ‘rb_iseq_compile_with_option’
/Users/danilobarsotti/.rvm/rubies/ruby-1.9.3-p194/include/ruby-1.9.1/ruby-1.9.3-p194/vm_core.h:505: error: previous declaration of ‘rb_iseq_compile_with_option’ was here
ruby_debug.c: In function ‘call_at_line_unprotected’:
ruby_debug.c:474: …
Run Code Online (Sandbox Code Playgroud) 我正在通过以下链接关注rails教程:http://ruby.railstutorial.org/chapters/filling-in-the-layout#code : static_page_routes
在/config/routes.rb文件中,我有
SampleApp::Application.routes.draw do
match '/contact', :to => 'pages#contact'
match '/about', :to => 'pages#about'
match '/help', :to => 'pages#help'
root :to => 'pages#home'
end
Run Code Online (Sandbox Code Playgroud)
当我运行该网站时,它给了我一个错误:没有路由存在页面/主页.我在论坛周围搜索,ppl建议把匹配'/ pages/home'=>'pages#home'
我做了:
SampleApp::Application.routes.draw do
match '/contact', :to => 'pages#contact'
match '/about', :to => 'pages#about'
match '/help', :to => 'pages#help'
match '/pages/home' => 'pages#home'
root :to => 'pages#home'
end
Run Code Online (Sandbox Code Playgroud)
一切正常.但现在,我的问题是,有什么区别
1. match '/something', :to => 'pages#something'
2. match '/something' => 'pages#something'
3. root :to => 'pages#home'
Run Code Online (Sandbox Code Playgroud)
基本上,我刚刚提出的代码.根本不应该采取主要主页,我不会需要匹配页面/主页=>页面#home?
太混乱了
谢谢!
编辑1:我没有得到我想要的答案,所以我认为我的问题是错的.我将其细分为两部分:
有什么区别: …
我正在将我的项目从Rails 3.2.12更新到4.0.0.我做了所有必要的更正但是当我尝试使用RubyMine 5.4执行我的应用程序时,我收到以下消息:
运行开发时出错:MyProject:找到Rails 3.x启动器脚本而不是Rails 4.x一个.您需要'/ Users/stackoverflowuser/RubymineProjects/MyProject/bin/rails'脚本来启动Rails服务器.请根据Rails 4.x文档更新服务器启动器.
我究竟做错了什么?
ruby-on-rails rubymine ruby-on-rails-3 ruby-on-rails-3.2 ruby-on-rails-4
我正在开发一个通过XMPP接收推送通知的应用程序(我知道C2DM,但它有一些限制,我不能因为它而使用),问题是连接一段时间后被垃圾收集而且我不能向Android设备发送推送通知.
我想我需要实现一个Android服务,但我不知道如何实现一个能保持连接活动的服务.有人可以帮帮我吗?
我想在我的rails应用程序中使用私有pub gem.我用railscast 316实现
后 rails g private_pub:install
我的private_pub.yml文件:
development:
server: "http://0.0.0.0:9292/faye"
secret_token: "secret"
test:
server: "http://0.0.0.0:9292/faye"
secret_token: "secret"
production:
server: "http://0.0.0.0/faye"
secret_token: "98ec77eb7077c9899dc53f003abc4d6a0170512a57feab126ed5a32b114e3613"
signature_expiration: 3600 # one hour
Run Code Online (Sandbox Code Playgroud)
我的private_pub.ru文件
# Run with: rackup private_pub.ru -s thin -E production
require "bundler/setup"
require "yaml"
require "faye"
require "private_pub"
Faye::WebSocket.load_adapter('thin')
PrivatePub.load_config(File.expand_path("../config/private_pub.yml", __FILE__), ENV["RAILS_ENV"] || "development")
run PrivatePub.faye_app
Faye::Logging.log_level = :debug
Faye.logger = lambda { |m| puts m }
Run Code Online (Sandbox Code Playgroud)
我的索引文件
<h1>Chat</h1>
<ul id="chat">
<%= render @mesajlar %>
</ul>
<%= form_for Mesaj.new, remote: true do …
Run Code Online (Sandbox Code Playgroud) ruby-on-rails ruby-on-rails-3 faye ruby-on-rails-3.2 private-pub
我有两个模式
1-用户
UserSchema = new db.Schema({
email: {type: String, required: true},
pass: {type: String, required: true},
nick: {type: String, required: true},
admin: {type: String, default: ''},
reg: {type: Date, default: Date.now}
});
Run Code Online (Sandbox Code Playgroud)
2-文章
ArticleSchema = new db.Schema({
title: {type: String, required: true},
alise: {type: String},
time: {type: Date, defaults: Date.now},
view: {type: Number, defaults: 0},
author: {type: String},
content: {type: String},
classes: {type: db.Schema.Types.ObjectId, ref: 'Classes'},
user: {type: String, ref: 'User'}
});
Run Code Online (Sandbox Code Playgroud)
我想要ArticleSchema用户字段关系UserSchema昵称。
我的代码:
Model.findOne({}).populate('classes user').exec(function(err, res){
if(err){
cb(err);
}else{ …
Run Code Online (Sandbox Code Playgroud) 我已经能够使用node.js和passport.js通过GitHub项目连接到Facebook,该项目位于:https: //github.com/jaredhanson/passport-facebook/tree/master/examples/login。
这是 app.js 代码正在执行的操作:
var express = require('express')
, passport = require('passport')
, util = require('util')
, FacebookStrategy = require('passport-facebook').Strategy
, logger = require('morgan')
, session = require('express-session')
, bodyParser = require("body-parser")
, cookieParser = require("cookie-parser")
, methodOverride = require('method-override');
var FACEBOOK_APP_ID = "--insert-facebook-app-id-here--"
var FACEBOOK_APP_SECRET = "--insert-facebook-app-secret-here--";
// Passport session setup.
// To support persistent login sessions, Passport needs to be able to
// serialize users into and deserialize users out of the session. Typically,
// this …
Run Code Online (Sandbox Code Playgroud) 嗨,大家好!只有两个Rails模型,用户和事件可以做到这一点:
Users
|id |name |age |
|1 |danilo |26 |
|2 |joe |23 |
|3 |carlos |50 |
|4 |katy |45 |
Events_Users
|event_id |user_id |confirmed |
|1 |1 |1 |
|3 |3 |0 |
|4 |3 |1 |
|2 |3 |1 |
Events
|id |name |date |
|1 |the end of the year |31/12/2012 |
|2 |the end of the world |21/12/2012 |
|3 |Party |18/12/2012 |
|4 |Dinner |19/12/2012 |
Run Code Online (Sandbox Code Playgroud)
问题是,用户可以确认他们是否存在于事件中,为此我使用了表Events_Users,确认了列(确认为1).如何在没有模型"Event_User"的情况下使用Rails ActiveRecord执行此操作?如何操作用户模型中的已确认列?
我正在使用Rails 3.2.9
如何将私有Bitbucket存储库迁移到公共Github存储库?
node.js ×2
ruby ×2
android ×1
bitbucket ×1
debugging ×1
faye ×1
github ×1
keep-alive ×1
many-to-many ×1
mongodb ×1
mongoose ×1
passport.js ×1
private-pub ×1
proxy ×1
push ×1
rubymine ×1
smack ×1
xmpp ×1