我在blue-host上使用rails 4,在安装过程中一切都很顺利。
来自我的共享计算机的输出:
# ruby --version && rails --version && rake --version && gem --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
Rails 4.2.4
rake, version 10.4.2
2.4.5.1
当我运行rails s时,rails app启动:
# rails s
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
=> Booting WEBrick
=> Rails 4.2.4 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-09-02 13:02:15] INFO WEBrick 1.3.1
[2015-09-02 13:02:15] INFO ruby 2.2.3 (2015-08-18) [x86_64-linux]
[2015-09-02 13:02:15] INFO WEBrick::HTTPServer#start: pid=11143 port=3000
这是我的.htaccess和dispatch.fcgi文件:
#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment"require 'fcgi_handler'
RailsFCGIHandler.process!
-
<IfModule mod_passenger.c>
Options -MultiViews
PassengerResolveSymlinksInDocumentRoot on
#Set this to whatever environment you'll be running in
#PassengerRuby /home1/myapp/ruby
RailsEnv production
RackBaseURI /
PassengerAppRoot /home1/user/rails_apps/myapp
SetEnv GEM_HOME /home1/user/ruby/gems
SetEnv GEM_PATH /home1/user/ruby/gems
</IfModule>
我将我的app public链接到〜/ public_html:
public_html -> rails_apps/myapp/public
但是当我从浏览器访问我的rails应用程序时出现错误Could not find rake-10.4.2 in any of the sources (Bundler::GemNotFound)
。