草庐IT

react-native-file-provider

全部标签

ruby - jruby -S bundle install jruby : No such file or directory -- bundle (LoadError)

我有我的ruby​​onrails应用程序,我已经在我的WindowsXP中安装了jruby-1.7.4。当我尝试运行jruby-Sbundleinstall时,它给我一个错误jruby:Nosuchfileordirectory--bundle(LoadError)我真的很纠结这个错误..请帮助.. 最佳答案 Bundler可能没有安装。您可以检查jruby-Sgemlist的输出来验证,然后安装它:jruby-Sgeminstallbundler一般来说,LoadError意味着您缺少gem依赖项。

ruby-on-rails - 回形针错误 : model missing required attr_accessor for 'avatar_file_name'

然后我想使用Paperclip为每个列表拍摄照片。我向listshow.html.erb、listing.rb模型、listings_controller.rb和_form.html.erb部分添加了适当的代码。当我尝试为list上传图片时出现此错误:Paperclip::ErrorinListingsController#updateListingmodelmissingrequiredattr_accessorfor'avatar_file_name'listings_controller的第44行:defupdaterespond_todo|format|if@listing.u

ruby-on-rails - ruby 包安装需要 : no such files to load error

我在通过git克隆的应用程序的bundleinstall安装gems时遇到了麻烦。这是bundleinstall的输出:bundleinstall/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8:in`require':nosuchfiletoload--rubygems(LoadError)from/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8from/usr/lib/ruby/vendor_ruby/bundler.rb:11:in`require'from/usr/lib

ruby - 导轨 : how to get a file extension/postfix based on the mime type

我的问题是,RubyonRails是否具有类似于以下的功能:file_content_type=MIME::Types.type_for(file).first.content_type这将返回特定mime类型的文件扩展名或后缀?所以如果我传入'image/jpeg'函数将返回'jpg'寻找一种比编写完成相同工作的case语句更简洁的编码方式。 最佳答案 Rack::Mime具有这种能力(Rack是Rails的依赖):require'rack/mime'Rack::Mime::MIME_TYPES.invert['image/jpe

ruby - 加载错误 : cannot load such file -- rspec/core/rake_task

当我rake的时候,我得到了这个错误。AllenLins-MacBook-Pro:geoblacklightallenlin$rake-tResolvingdependencies...Youmust`geminstallbundler`and`bundleinstall`torunraketasksrakeaborted!LoadError:cannotloadsuchfile--rspec/core/rake_task/Users/allenlin/Documents/USpatial/geoblacklight/Rakefile:12:in`require'/Users/alle

ruby - "file.sync = true"是做什么的?

我查看了文档,但似乎找不到相关部分。谁能告诉我以下代码中调用sync的目的是什么?fh=Tempfile.new('tmp')fh.sync=true 最佳答案 它设置文件的同步模式。这会影响future的操作并导致在没有block缓冲的情况下写入输出。如果f.tty?为真,也就是说,如果文件连接到类似控制台的设备,则输出不是block缓冲的。但是,当输出到管道或文件时,f.tty?将为false,I/O库将切换到block缓冲,也就是说,将输出累积到一个缓冲区并仅在文件关闭、程序退出或缓冲区已满时写入它。这样速度更快,最终结果相同

ruby - 究竟什么是 gem native 扩展?

我觉得native扩展就像库一样,您应该在尝试安装依赖于native扩展的那些gem之前将其安装到系统中。像ImageMagic库。那是对的吗?关于native扩展,还有什么我们应该了解的吗? 最佳答案 gemnative扩展可能链接到需要预安装的单独库,RMagick就是一个例子。但是,该术语实际上仅表示“包括一些需要为您的机器编译的代码”。代码被编译和链接,因此生成的可执行文件可以被机器上的Ruby要求。编写RubyC或C++扩展的常见原因是:速度。对于一些CPU密集型任务,C代码可以比Ruby快100倍。在这种情况下,nati

ruby - Vagrant File Chef 属性

我正在尝试将我的Vagrant文件配置为具有一些Chef属性,但我一定是做错了什么,因为ChefRecipe使用的是默认值而不是我试图设置的属性。这是我的vagrant文件的配置部分:config.vm.provision:chef_solodo|chef|chef.json={:mysql=>{:server_root_password=>'password'},:nodejs=>{:version=>'0.6.14',:dir=>'/usr/local',:npm=>'1.1.13'}}chef.cookbooks_path="config/env/cookbooks"chef.a

ruby-on-rails - bundle 安装 : ERROR: Failed to build gem native extension. nio4r gem

我目前正在使用以下项目进行项目:rvm1.26.11ruby2.2.1p85我尝试运行bundleinstall但不断收到以下错误:Gem::Ext::BuildError:ERROR:Failedtobuildgemnativeextension.并且,以下:Anerroroccurredwhileinstallingnio4r(1.0.0),andBundlercannotcontinue.Makesurethat`geminstallnio4r-v'1.0.0'`succeedsbeforebundling.当我尝试运行geminstallnio4r-v'1.0.0'时:Buil

ruby - 错误 : Error installing ffi: ERROR: Failed to build gem native extension

安装了DevKit并重新运行ffi安装…。将其作为输出:C:\DocumentsandSettings\******>geminstallffiTemporarilyenhancingPATHtoincludeDevKit...Buildingnativeextensions.Thiscouldtakeawhile...ERROR:Errorinstallingffi:ERROR:Failedtobuildgemnativeextension.C:/Ruby192/bin/ruby.exeextconf.rbcheckingforffi.h...nocheckingforffi.hin