草庐IT

curr_file

全部标签

ruby-on-rails - Heroku 应用程序崩溃 H10 - bash : bin/rails: No such file or directory

这个问题在这里已经有了答案:"bin/rails:Nosuchfileordirectory"w/Ruby2&Rails4onHeroku(8个答案)关闭8年前。我的部署有问题。我的测试环境在本地运行良好,没有错误。当我推送到Heroku时,我得到了这个:2013-07-17T15:54:04.619297+00:00app[web.1]:bash:bin/rails:Nosuchfileordirectory2013-07-17T15:54:07.240398+00:00heroku[web.1]:Processexitedwithstatus1272013-07-17T15:54:

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 - 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 - ruby 错误 : cannot load such file -- rest-client

我正在使用RubyonRails4。我正在努力require'rest-client'在我的Controller中,以便我可以解析从表单中获取的登录信息并将其发送到API。我可以验证gem是否已安装并且也在我的应用程序根目录下的Gemfile中。但是,当我尝试在我的Controller中请求该文件时,它仍然抛出“无法加载此类文件--rest-client”。我用谷歌搜索了这个错误,我看到的大部分答案要么是gem没有安装,要么不在Gemfile中,要么是两者兼而有之。这里的情况也不是。我的Controller是否由于某种原因无法访问rest-clientgem?我必须使用rest-cli

ruby-on-rails - 在 `require' : no such file to load -- iconv (LoadError)

➜expertizagit:(master)✗ruby-vruby1.8.7(2011-06-30patchlevel352)[i686-darwin11.1.0]➜expertizagit:(master)✗rails-vRails2.3.14➜expertizagit:(master)✗script/server/Users/HPV/.rvm/gems/ruby-1.8.7-p352/gems/activesupport-2.3.14/lib/active_support/inflector.rb:3:in`require':nosuchfiletoload--iconv(Load