当我尝试运行捆绑安装时,我收到此错误:
Installing hiredis (0.3.2) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby1.9.2/bin/ruby.exe extconf.rb
gcc -std=c99 -pedantic -c -O3 -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
net.c:1:0: warning: -fPIC ignored for target (all code is position independent)
net.c:35:24: fatal error: sys/socket.h: No such file or directory
compilation terminated.
make: *** [net.o] Error 1
creating Makefile
make
C:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_hiredis_ext'" > hiredis_ext-i386-mingw32.def
gcc -I. -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/i386-mingw32 -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1 -I. -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings …Run Code Online (Sandbox Code Playgroud) 我正在使用highcharts绘制一些图表.我使用这样的基本线图:
http://www.highcharts.com/demo/spline-irregular-time
如何在图表区域下方而不是在右侧显示图例?
http://www.highcharts.com/demo/column-stacked-percent
谢谢
如何在textarea上默认启用wysiwyg?我的意思是,我不想点击wysiwyg按钮来显示tinyMCE区域:

我直接想要这个:

我有使用rails的性能问题.当我对这样的控制器进行ajax调用时:
def test
@hotels = Hotel.all
render :json => ['hotels' => @hotels ], :include=> [:country, :city]
end
Run Code Online (Sandbox Code Playgroud)
完成大约需要2-5秒.我的数据库中只有40家酒店.我认为它很长......例如,Django上的相同请求将需要400ms
我忘了配置好我的环境吗?
我使用Rails entreprise版本和乘客.
编辑:我的日志文件:
Started GET "/hotels/test.json" for 172.16.81.1 at Wed Oct 12 22:11:06 +0200 2011
[paperclip] Duplicate URL for image with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in HotelImage class
[paperclip] Duplicate URL for thumbnail with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in Hotel class
[paperclip] Duplicate URL for map with /system/:attachment/:id/:style/:filename. This will clash with attachment defined in …Run Code Online (Sandbox Code Playgroud) 我有一个模特:
class HotelTheme < ActiveRecord::Base
has_many :hotels
end
Run Code Online (Sandbox Code Playgroud)
我想随机获得6家酒店.
我试过了:
@hotelTheme.hotels.rand(6)
Run Code Online (Sandbox Code Playgroud)
但它失败了,任何想法?
谢谢
我有一个UISlider与minimumValue 0和maximumValue.我想打一个interval的0.5,并在显示它label(它的工作).
我怎样才能设置我的间隔slider?我试过解决方案来绕过价值...但我失败了.
谢谢
我想在我的应用上删除孤立的项目.所以我这样做了:
for (Card *c in fetchedResultsController.fetchedObjects) {
BOOL result = NO;
for (Card * remove_card in remoteResultArray) {
if ([remove_card.id intValue] == [c.id intValue]) {
result = YES;
}
}
if (!result) {
NSLog(@"%@",c.id);
[[RKManagedObjectStore defaultStore].mainQueueManagedObjectContext deleteObject:c];
}
}
[[RKManagedObjectStore defaultStore].mainQueueManagedObjectContext save:&error];
Run Code Online (Sandbox Code Playgroud)
实际上它有效,我的记录消失但是当我重新启动应用程序时,它们又在这里.如何使用restkit删除记录?
我有两个型号:
class Album(models.Model):
#Attributes
title = models.CharField(max_length=200)
displayed = models.BooleanField()
created_on = models.DateTimeField(auto_now_add=True)
class Photos(models.Model):
#Attributes
title = models.CharField(max_length=500)
link = models.CharField(max_length=500)
album = models.ForeignKey(Album, unique=False, verbose_name=_('album'))
def upload_path(self, filename):
return 'upload/photos/%s/%s' % (self.id, filename)
def upload_path_thumbnail(self, filename):
return 'upload/photos/%s/%s' % (self.id, "thumnail_" +filename)
thumbnail = models.ImageField(upload_to=upload_path_thumbnail)
photo = models.ImageField(upload_to=upload_path)
created_on = models.DateTimeField(auto_now_add=True)
displayed = models.BooleanField()
Run Code Online (Sandbox Code Playgroud)
我想强制,当我选择照片时,总是过滤显示= 1.
谢谢
我希望在用户在textarea(使用Javascript)中输入html时显示html.像这样 :
Every thing fine <a href="/toto"> link </a>
Run Code Online (Sandbox Code Playgroud)
如果不使用"预"标签,我怎么能这样做?我只是想避免html解释.
谢谢
javascript ×2
objective-c ×2
ruby ×2
activerecord ×1
bundle ×1
core-data ×1
css ×1
django ×1
filter ×1
gem ×1
highcharts ×1
html ×1
ios ×1
ios5 ×1
magento ×1
magento-1.7 ×1
restkit ×1
uislider ×1