gem命令(版本1.8.1,可能是1.8.0)在每次调用时都会发出一吨弃用通知.浏览警告屏幕以查看测试输出是痛苦的.
是否有一种隐藏弃用通知的简单方法?特别警告:
NOTE: Gem::Specification#default_executable= is deprecated with no replacement.
在主题中:他们是否相互竞争,重叠或相互补充?
谢谢,
佩特罗斯
这是干净安装的OSX 10.7 Lion.这是我采取的行动:
我安装了Xcode(4.1)
我安装了RVM(1.8.0):
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)
我安装了ruby 1.8.7和1.9.2
rvm install 1.8.7
rvm install 1.9.2
Run Code Online (Sandbox Code Playgroud)
我将开关切换到1.8.7
rvm use 1.8.7
Run Code Online (Sandbox Code Playgroud)
我安装了一个宝石
gem install json
Run Code Online (Sandbox Code Playgroud)
我在ruby文件中使用那个gem.
require 'json'
Run Code Online (Sandbox Code Playgroud)
我尝试运行该ruby文件并收到以下错误:
main.rb.txt:1:in `require': no such file to load -- json (LoadError)
Run Code Online (Sandbox Code Playgroud)
我仔细检查我的宝石:
gem list
Run Code Online (Sandbox Code Playgroud)
..够了,它安装好了.
*** LOCAL GEMS ***
json (1.5.4)
rack (1.3.2)
rake (0.9.2 ruby)
sinatra (1.2.6)
tilt (1.3.3)
Run Code Online (Sandbox Code Playgroud)
无论我需要什么样的宝石,这个问题都会出现.但是,如果我切换到1.9.2,一切正常.
我已经使用RVM卸载并重新安装了ruby 1.8.7(以及其他所有版本).我已经卸载并重新安装了宝石宝石.我错过了什么?
附加信息:宝石版本:1.8.6
我在哪里可以找到它?我正在运行OSX.
此外,我必须在旅行时离线做很多工作,所以如果有人可以提供可下载文档的任何提示,请告诉我.
如果我运行"Rails s"或"rails generate active_admin:install"或其他所有内容,我也会收到此错误...这是什么意思?
我已经运行"捆绑安装"或"捆绑更新".(RAILS 3.1.3)
/Library/Ruby/Gems/1.8/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:198:in `to_proc': undefined method `to_sym' for #<Hash:0x1038c0498> (NoMethodError)
from /Library/Ruby/Gems/1.8/gems/devise-1.5.2/lib/devise/rails/routes.rb:190:in `map!'
from /Library/Ruby/Gems/1.8/gems/devise-1.5.2/lib/devise/rails/routes.rb:190:in `devise_for'
from /Users/leonardopellicciotta/dev/webtelevideo/config/routes.rb:7
from /Library/Ruby/Gems/1.8/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:258:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:258:in `eval_block'
from /Library/Ruby/Gems/1.8/gems/actionpack-3.1.3/lib/action_dispatch/routing/route_set.rb:235:in `draw'
from /Users/leonardopellicciotta/dev/webtelevideo/config/routes.rb:1
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:29:in `load_paths'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:29:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:29:in `load_paths'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/application/routes_reloader.rb:13:in `reload!'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:87:in `reload_routes!'
from /Library/Ruby/Gems/1.8/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:34:in `reload!'
from /Library/Ruby/Gems/1.8/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:28:in `initialize'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/file_update_checker.rb:32:in `call'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.3/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Library/Ruby/Gems/1.8/gems/activeadmin-0.3.4/lib/active_admin/reloader.rb:45:in …Run Code Online (Sandbox Code Playgroud) 不知怎的,我的rails安装成功隐藏了......
我有:
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
rvm 1.10.0-pre
gem 1.8.10
Run Code Online (Sandbox Code Playgroud)
我尝试安装rails:
sudo gem install rails
Run Code Online (Sandbox Code Playgroud)
它工作正常:
Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
Installing RDoc documentation for rails-3.1.3...
Run Code Online (Sandbox Code Playgroud)
当我做:
rails - v
Run Code Online (Sandbox Code Playgroud)
我明白了
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
Run Code Online (Sandbox Code Playgroud)
而且,当我这样做
rake
Run Code Online (Sandbox Code Playgroud)
在rails app根目录中,我得到:
Missing the Rails gem. Please `gem install -v= rails`, update your
RAILS_GEM_VERSION setting in config/environment.rb for the Rails version
you …Run Code Online (Sandbox Code Playgroud) 我是Ruby on Rails的新手,现在尝试安装ROR.我按照这个教程http://blog.sudobits.com/2011/10/27/how-to-install-ruby-on-rails-in-ubuntu-11-10/
安装完成后,gem install rails创建我的项目就像rails new myproject.这里显示此消息
Your bundle is complete! Use捆绑秀[gemname] to see where a bundled gem is installed..
之后我运行bundle install它显示此错误Could not locate Gemfile.
请帮帮我怎样才能解决这个问题.
我正在使用以下Spreadsheet gem从ruby-on-rails生成excel表.http://spreadsheet.rubyforge.org/GUIDE_txt.html
我想格式化一个单元格,以便我可以看到它的顶部和底部边框,但不是任何其他边框.有没有人去过那里并且知道如何做?
http://spreadsheet.rubyforge.org/Spreadsheet/Format.html
- (Object)border =(boolean)激活或停用所有四个边框(左,右,上,下).
我在Ubuntu 11.10上运行RubyMine 4,RubyMine中的每一件事情都很好,我可以运行服务器,开发等等.但是,当我需要在命令行上工作时,我什么都做不了..
我cd到我的app目录,然后我试着:
$ rails s
Run Code Online (Sandbox Code Playgroud)
我明白了:
The program 'rails' is currently not installed. You can install it by typing:
sudo apt-get install rails
Run Code Online (Sandbox Code Playgroud)
这很奇怪,为什么我没有安装它,而我可以在RubyMine IDE中正常工作!
我需要使用命令行卸载gem,发现我不能使用命令行,因为它应该...
sam@ubuntu:~/Documents/RoR/course_builder$ gem uninstall 'capybara-firebug'
ERROR: While executing gem ... (Gem::InstallError)
cannot uninstall, check `gem list -d capybara-firebug`
Run Code Online (Sandbox Code Playgroud)
$ gem list -d 会给我:
*** LOCAL GEMS ***
Run Code Online (Sandbox Code Playgroud)
那里没有宝石..
如果我输入:
$ bundle install
Run Code Online (Sandbox Code Playgroud)
我明白了:
/usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8:in `require': no such file to load -- rubygems (LoadError)
from /usr/lib/ruby/vendor_ruby/bundler/rubygems_ext.rb:8
from /usr/lib/ruby/vendor_ruby/bundler.rb:11:in `require'
from /usr/lib/ruby/vendor_ruby/bundler.rb:11
from /usr/bin/bundle:4:in `require' …Run Code Online (Sandbox Code Playgroud) 我试图用roo gem解析XLS文件,而不使用文件上传插件.不幸的是我无法访问文件的数据.
我收到错误:
#<File:0x007ffac2282250> is not an Excel file
Run Code Online (Sandbox Code Playgroud)
所以roo没有将文件识别为Excel文件.我是否需要在本地保存文件以使用roo,或者有办法解决这个问题.我想将excel文件的数据直接解析到数据库中.
通过的参数:
Parameters: {"utf8"=>"?", "authenticity_token"=>"yLqOpSK981tDNYjKSoWBh0VnFEKSk0XA/wOt3r+yWJc=", "uploadform"=>{"name"=>"xls", "file"=>#<ActionDispatch::Http::UploadedFile:0x007ffac22b6550 @original_filename="cities2.xls", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"uploadform[file]\"; filename=\"cities2.xls\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#<File:/var/folders/qn/70msrkt90pd390sdr14_0g2m0000gn/T/RackMultipart20120306-3729-1m2xcsp>>}, "commit"=>"Save Uploadform"}
Run Code Online (Sandbox Code Playgroud)
我正在尝试访问该文件
if params[:uploadform][:file].original_filename =~ /.*\.xls$/i
oo = Excel.new(params[:uploadform][:file].open)
rooparse(oo)
end
Run Code Online (Sandbox Code Playgroud)
我也尝试了params [:uploadform] [:file] .read和params [:uploadform] [:file],但我认为.open将是正确的方法!?
你会建议在这里使用paperclip或carrierwave吗?
谢谢您的帮助!
gem ×10
ruby ×6
rvm ×2
amazon-s3 ×1
deprecated ×1
fog ×1
formatting ×1
install ×1
refinerycms ×1
rubygems ×1
rubymine ×1
spreadsheet ×1
ubuntu-11.10 ×1