关于安装railsinstaller后的Windows 7的Ruby on rails,我面临很多问题,不知道是什么原因?
PS:我把这个问题发布在堆栈溢出上,在其他地方寻找类似问题的答案,在那里一位先生build议我把我的问题放在单独的线程。 在这里呢。
Windows 7在代理和websense之后。 我以pipe理员身份运行所有应用 我想知道我是否因为我面临的问题而离开任何网站/博客。 虽然这是我的第一个问题在ROR堆栈溢出后,我用尽阅读和search解决它的选项。
我甚至无法做到这一点
$ gem install rubygems-update
虽然我的path是正确的,并显示
c:\>gem sources
显示
http://rubygems.org.
作为唯一的来源。
即使简单的数据库创build,我仍然得到以下错误。 这是在sample rails项目的根目录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:\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
与最新版本的导轨,安装使用railsinstaller一键单击窗口。 之后我做了捆绑安装,运行成功,但问题没有消失。
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:\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>
我的gem版本是
C:\RailsInstaller\Ruby1.9.3\lib\ruby\gems\1.9.1\gems>gem -v 1.8.16
我试图从网站(从http://rubygems.org/gems/ )手动下载gem,并安装了几个。 所以能够安装一些,而其他大多数gem,它会给下面的错误
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
最后,我的环境详细信息是gem
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:/Users/anil-ku/.gem/ruby/1.9.1下面没有任何像ruby文件夹,上面的唯一一个是名为specs的文件夹看起来不相关。
path环境也是windows
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的帮助?
您需要为rubygems设置您的代理设置。 例如像这样设置环境变量:
SET HTTP_PROXY = http:// wolfbyte:secret @ pigsy:8080