2
*** LOCAL GEMS ***

rails (3.2.8)
heroku (2.33.0)
heroku-api (0.3.6)
taps (0.3.24)

今朝まで何ヶ月も働いていたにもかかわらず、実行heroku db:pullするとスキーマが取り込まれ始めますが、最終的には次のようになります。

Schema:         23% |=========                                 | ETA:  00:02:17
Schema:         23% |=========                                 | ETA:  00:02:15
Schema:         24% |==========                                | ETA:  00:02:13
Schema:         25% |==========                                | ETA:  00:02:11
Schema:         26% |==========                                | ETA:  00:02:09
Schema:         26% |==========                                | ETA:  00:02:08
Schema:         27% |===========                               | ETA:  00:02:06
Schema:         28% |===========                               | ETA:  00:02:04
Schema:         29% |============                              | ETA:  00:02:02
Schema:         29% |============                              | ETA:  00:02:00
Schema:         30% |============                              | ETA:  00:02:01
Saving session to pull_201211010614.dat..
!!! Caught Server Exception
HTTP CODE: 500
Taps Server Error: undefined method `database_url' for #<DbSession:0x00000002710b18>
["/app/lib/taps/server.rb:149:in `block in <class:Server>'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:865:in `block in route'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `instance_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:521:in `route_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:500:in `block (2 levels) in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:497:in `block in route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:476:in `route!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:601:in `dispatch!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `block in call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `instance_eval'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `block in invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:566:in `invoke'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:411:in `call!'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:399:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `block in call'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in `synchronize'", "/app/.bundle/gems/ruby/1.9.1/gems/sinatra-1.0/lib/sinatra/base.rb:979:in `call'", "/home/heroku_rack/lib/static_assets.rb:9:in `call'", "/home/heroku_rack/lib/last_access.rb:15:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:47:in `block in call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `each'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/urlmap.rb:41:in `call'", "/home/heroku_rack/lib/date_header.rb:14:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/rack-1.2.1/lib/rack/builder.rb:77:in `call'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:76:in `block in pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `catch'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:74:in `pre_process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:57:in `process'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/connection.rb:42:in `receive_data'", "/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'", "/app/.bundle/gems/ruby/1.9.1/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/backends/base.rb:57:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/server.rb:156:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:80:in `start'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_command'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in `run!'", "/app/.bundle/gems/ruby/1.9.1/gems/thin-1.2.7/bin/thin:6:in `<top (required)>'", "/app/.bundle/gems/ruby/1.9.1/bin/thin:19:in `load'", "/app/.bundle/gems/ruby/1.9.1/bin/thin:19:in `<main>'"]

誰もこれを見たことがありますか?


Xcode データ コントローラーの問題

次の部分を持つアプリケーションがあります。

  • StoreDataController.h
  • StoreDataController.m
  • StoreTableViewController.h
  • StoreTableViewController.m

URL からデータを取得して JSON に変換する StoreDataController のプロパティとメソッドを作成しました。次に、それを配列に格納します。テーブル コントローラにテーブル内の配列を表示させようとしていますが、表示されません。テーブルに配列の内容を表示するにはどうすればよいですか? ここに私が持っているコードがあります:

StoreDataController.h

@interface StoreDataController : NSObject
@property (nonatomic, retain) NSArray *storeNames;
-(void)addStoreNamesObject:(NSArray *)storeNames;
@end

StoreDataController.m

#import "StoreDataController.h"
#import "SBJson.h"

@implementation StoreDataController

-(void)addStoreNamesObject:(NSArray *)storeNames
{
NSString *strURL = [NSString stringWithFormat:@"http://10.247.245.87/stores/dodge.php"];
NSData *dataURL = [NSData dataWithContentsOfURL:[NSURL URLWithString:strURL]];
NSString *strResult = [[NSString alloc] initWithData:dataURL encoding:NSUTF8StringEncoding];
storeNames = [strResult JSONValue];
}
@end

StoreTableViewController.h

#import <UIKit/UIKit.h>
@class StoreDataController;

@interface StoreTableViewController : UITableViewController

@property (nonatomic, retain) StoreDataController *storeNameController;
@end

StoreTableViewController.m

#import "StoreTableViewController.h"
#import "StoreDataController.h"

@interface StoreTableViewController ()

@end

@implementation StoreTableViewController

- (void)awakeFromNib
{
    [super awakeFromNib];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return _storeNameController.storeNames.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath      *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

    cell.textLabel.text = [_storeNameController.storeNames objectAtIndex:indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
 <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];

 [self.navigationController pushViewController:detailViewController animated:YES];
 */
}
@end
4

1 に答える 1

2

これは、今日の 3 回目または 4 回目の試行で機能することがわかりました。問題は、db:pull プロセスが非常に遅いため、別のオプションを探す必要があるということです。このソリューションをチェックしてください:

https://stackoverflow.com/a/5675869/195530

于 2012-11-01T16:10:57.943 に答える