我一时就坐下来了。 我试图从我的可可申请中操作一条铁路,制造一条新闻铁路。 一. 导言
~/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/bin/rails new projectname
我能够创建一个新的项目。 但是,如果我这样作的话,我会这样做。
NSString *path = @"~/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/bin/rails";
NSString *script = [NSString stringWithFormat:@"%@ new ~/Desktop/testapp", path];
system([script UTF8String]);
或
- (IBAction)buildProject:(NSButton *)sender
{
NSString *path = @"~/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/bin/rails";
NSArray *args = [NSArray arrayWithObjects:@"new", @"~/Desktop/testapp", nil];
NSTask *task = [NSTask new];
[task setLaunchPath:path];
[task setArguments:args];
[task launch];
}
我发现以下错误:
/Users/dylanross/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/bin/rails:7:in `require : no such file to load -- rails/cli (LoadError)
from /Users/dylanross/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/bin/rails:7