首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >websense和防火墙背后的Windows 7中的Rails问题

websense和防火墙背后的Windows 7中的Rails问题
EN

Stack Overflow用户
提问于 2012-12-10 11:22:25
回答 1查看 1.2K关注 0票数 3

关于windows 7中的rails,安装了railsinstaller之后,我面临很多问题,不知道原因是什么?

PS:我把这个问题放在堆叠溢出的地方,在寻找类似问题的答案的时候,一位先生建议我把我的问题放在单独的线程上。现在开始了。

windows 7在proxy和websense之后。我以管理员身份运行所有应用程序。我想知道我是否为我所面临的问题离开了任何网站/博客。虽然这是我在这里的第一个问题,在堆叠溢出,在我用尽了阅读和搜索解决它的选择。

我甚至不能做

代码语言:javascript
复制
$ gem install rubygems-update 

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

代码语言:javascript
复制
c:\>gem sources

显示

代码语言:javascript
复制
http://rubygems.org.

作为唯一的来源。

对于即使是简单的数据库创建,我仍然得到以下错误。这是在示例rails项目的根目录中给出的,即SampleROR。有什么帮助吗。

代码语言:javascript
复制
$ 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)

请注意我做不到

代码语言:javascript
复制
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem update --system
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

使用最新版本的rails,安装时使用railsinstaller一次单击windows。在此之后,我进行了包安装,运行成功,但问题并没有消失。

代码语言:javascript
复制
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

当我列出

代码语言:javascript
复制
$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已安装。不知道是什么问题。

代码语言:javascript
复制
$ rails --version
Rails 3.2.1

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

代码语言:javascript
复制
C:\RailsInstaller\rubygems>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:\RailsInstaller\rubygems>

我的宝石版本是

代码语言:javascript
复制
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem -v
1.8.16

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

代码语言:javascript
复制
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel_services
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel_service
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel_service-0.4.0.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel-1.1.5.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install mongrel2-0.34.0.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>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:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem install windows-api-0.4.2.gem
ERROR:  While executing gem ... (Zlib::GzipFile::Error)
    not in gzip format

最后,我的创业板环境细节是

代码语言:javascript
复制
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>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:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>

我注意到C:/User/anil-ku/..gem/ ruby /1.9.1下没有任何东西像ruby文件夹那样,上面的文件夹中唯一的内容是一个看起来不相关的名为specs的文件夹。

另外,路径环境是windows

代码语言:javascript
复制
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>echo %PATH%
C:\RailsInstaller\Ruby1.9.3\bin;C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\bin;C:\RailsInstaller\DevKit\bin;C:\RailsInstaller\Git\c
md;C:\RailsInstaller\Ruby1.9.3\bin;C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\bin;C:\RailsInstaller\DevKit\bin;C:\RailsInstaller\Gi
t\cmd;C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby1.9.3\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\Syste
m32\WindowsPowerShell\v1.0\;;C:\Program Files\cvsnt;C:\Program Files\TortoiseSVN\bin;d:\RailsInstaller\Git\cmd;d:\RailsInstaller\Ruby1.9
.3\bin

对于如何进行上述简单的数据库连接和/或如何完全安装gem,有什么帮助吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-07 08:51:49

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

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

来自https://stackoverflow.com/a/4431/192221

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13799983

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档