Ruby on Rails问题在Windows7中的websense和防火墙后面



关于windows 7中rails上的Ruby。安装轨道安装器后,我面临着很多问题,不确定原因是什么?

附言:我把这个问题发布在堆栈溢出上,在其他地方寻找类似问题的答案,一位先生建议我把我的问题放在另一个线程上。它来了。

windows 7位于代理和websense之后。我以管理员身份运行所有应用程序。我想知道我是否因为面临的问题而离开了任何网站/博客。尽管这是我在用尽阅读和搜索选项来解决ROR堆栈溢出问题后的第一个问题

我甚至不能做

$ gem install rubygems-update 

虽然我的路径是正确的,并显示

c:>gem sources

显示

http://rubygems.org.

作为唯一的来源。

即使是简单的数据库创建,我仍然会收到以下错误。这是在samplerails项目的根目录中给出的,即SampleROR。请帮忙。

$ rake db:create
The i18n gem is not available. Please add it to your Gemfile and run bundle install
rake aborted!
cannot load such file -- i18n
c:/RailsInstaller/DevKit/home/anil-ku/SampleROR/config/application.rb:3:in `require'
c:/RailsInstaller/DevKit/home/anil-ku/SampleROR/config/application.rb:3:in `<top (required)>'
c:/RailsInstaller/DevKit/home/anil-ku/SampleROR/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

注意,我不能做

C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem update --system
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format

最新版本的rails,使用railsinstaller一键安装windows。之后我安装了捆绑包,运行成功,但问题并没有消失。

anil-ku@hostname ~/SampleROR
$ bundle install
Using rake (10.0.2)
**Using i18n (0.6.1)**
Using multi_json (1.4.0)
Using activesupport (3.2.1)
Using builder (3.0.4)
Using activemodel (3.2.1)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.1)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.12)
Using mail (2.4.4)
Using actionmailer (3.2.1)
Using arel (3.0.2)
Using tzinfo (0.3.35)
Using activerecord (3.2.1)
Using activeresource (3.2.1)
Using bundler (1.0.22)
Using coffee-script-source (1.4.0)
Using execjs (1.4.0)
Using coffee-script (2.2.0)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.14.6)
Using railties (3.2.1)
Using coffee-rails (3.2.2)
Using jquery-rails (2.1.4)
Using rails (3.2.1)
Using sass (3.2.3)
Using sass-rails (3.2.5)
Using sqlite3 (1.3.6)
Using uglifier (1.3.0)
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem
is installed.
anil-ku@DS-7071BC8FD6C4 ~/SampleROR
**$ bundle show i18n**
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/i18n-0.6.1

当我列出时

$gem list -local
actionmailer (3.2.1)
actionpack (3.2.1)
activemodel (3.2.9, 3.2.1)
activerecord (3.2.1)
activerecord-sqlserver-adapter (3.2.1)
activeresource (3.2.1)
activesupport (3.2.9, 3.2.1)
archive-tar-minitar (0.5.2)
arel (3.0.2)
bigdecimal (1.1.0)
builder (3.0.4, 3.0.0)
bundler (1.0.22)
cgi_multipart_eof_fix (2.5.0)
coffee-rails (3.2.2)
coffee-script (2.2.0)
coffee-script-source (1.4.0, 1.2.0)
columnize (0.3.6)
daemons (1.1.9)
debugger-linecache (1.1.2)
debugger-ruby_core_source (1.1.5)
deprecated (3.0.1, 2.0.1)
erubis (2.7.0)
execjs (1.4.0, 1.3.0)
fastthread (1.0.7)
gem_plugin (0.2.3)
hike (1.2.1)
hoe (3.3.1)
**i18n (0.6.1, 0.6.0)**
io-console (0.3)
journey (1.0.4, 1.0.2)
jquery-rails (2.1.4)
json (1.7.5, 1.5.4)
mail (2.4.4, 2.4.1)
mime-types (1.19, 1.17.2)
minitest (4.3.3, 2.5.1)
multi_json (1.4.0, 1.3.7, 1.1.0)
mysql2 (0.3.11)
permutation (0.1.8)
pg (0.13.1 x86-mingw32)
polyglot (0.3.3)
rack (1.4.1)
rack-cache (1.2, 1.1)
rack-ssl (1.3.2)
rack-test (0.6.2, 0.6.1)
rails (3.2.1)
railties (3.2.1)
rake (10.0.2, 0.9.2.2)
rake-compiler (0.8.1)
rb-readline (0.4.2)
rbx-require-relative (0.0.9)
rdoc (3.12, 3.9.4)
ruby_core_source (0.1.5)
rubyzip (0.9.6.1)
sass (3.2.3)
sass-rails (3.2.5)
sdoc (0.3.20)
sprockets (2.1.3, 2.1.2)
sqlite3 (1.3.6 x86-mingw32, 1.3.5 x86-mingw32)
sqlite3-ruby (1.3.3)
thor (0.14.6)
tilt (1.3.3)
tiny_tds (0.5.1 x86-mingw32)
treetop (1.4.12, 1.4.10)
tzinfo (0.3.35, 0.3.31)
uglifier (1.3.0)

它显示i18n已安装。不确定问题出在哪里。

$ rails --version
Rails 3.2.1

此外,下载gem包并使用ruby setup.rb运行它也不起的作用

C:RailsInstallerrubygems>ruby setup.rb
C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems.rb:480:in `find_files': undefined method `map' for Gem::Specification:Class (NoMethodError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems.rb:1085:in `load_plugins'
from C:/RailsInstaller/rubygems/lib/rubygems/gem_runner.rb:84:in `<top (required)>'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from setup.rb:25:in `<main>'
C:RailsInstallerrubygems>

我的gem版本是

C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem -v
1.8.16

我尝试从网站手动下载gem(从http://rubygems.org/gems/)并且安装了很少的。因此能够安装一些,而对于大多数其他宝石,它会出现错误,如下面的

C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install mongrel
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install mongrel_services
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install mongrel_service
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install mongrel_service-0.4.0.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install mongrel-1.1.5.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install mongrel2-0.34.0.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install win32-api-1.4.8.gem
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed win32-api-1.4.8
1 gem installed
Installing ri documentation for win32-api-1.4.8...
Installing RDoc documentation for win32-api-1.4.8...
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem install windows-api-0.4.2.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
not in gzip format

最后,我的gem环境细节是

C:RailsInstallerRuby1.9.3librubygems1.9.1gems>gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.16
- RUBY VERSION: 1.9.3 (2012-02-16 patchlevel 125) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby1.9.3/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1
- C:/Users/anil-ku/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
C:RailsInstallerRuby1.9.3librubygems1.9.1gems>

我注意到下面没有比ruby文件夹更好的了C:/Users/anil-ku/.gem/ruby/1.9.1上面的文件夹下只有一个名为specs的文件夹,看起来不相关。

此外,路径环境是windows是

C:RailsInstallerRuby1.9.3librubygems1.9.1gems>echo %PATH%
C:RailsInstallerRuby1.9.3bin;C:RailsInstallerRuby1.9.3librubygems1.9.1bin;C:RailsInstallerDevKitbin;C:RailsInstallerGitc
md;C:RailsInstallerRuby1.9.3bin;C:RailsInstallerRuby1.9.3librubygems1.9.1bin;C:RailsInstallerDevKitbin;C:RailsInstallerGi
tcmd;C:RailsInstallerGitcmd;C:RailsInstallerRuby1.9.3bin;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSyste
m32WindowsPowerShellv1.0;;C:Program Filescvsnt;C:Program FilesTortoiseSVNbin;d:RailsInstallerGitcmd;d:RailsInstallerRuby1.9
.3bin

关于如何继续使用上面的简单数据库连接和/或如何完全安装gem,有什么帮助吗?

您需要为rubygems设置代理设置。例如,将环境变量设置为:

设置HTTP_PROXY=http://wolfbyte:secret@pigsy:8080

发件人https://stackoverflow.com/a/4431/192221

最新更新