Rails 3.2.6安装在Centos6上

时间:2012-07-25 23:18:57

标签: ruby ruby-on-rails-3 centos centos6

我按顺序执行了以下步骤,但运行webrick时出现问题

我有一个centos 6安装

第1步: http://blog.jeffcosta.com/2011/07/22/install-ruby-version-manager-rvm-on-centos-6/

第2步: server-world.info/en/note?os=CentOS_6&p=mysql

第3步: sudo install mysql - --with-mysql-config = / usr / local / mysql / bin / mysql_config gem install -y mysql - --with-mysql-config = / usr / bin / mysql_config

它安装了所有宝石而没有任何问题。

但是当我从使用
创建的应用程序加载webrick时 rails new simple_cms -d mysql

结果: 创建
      创建README.rdoc
      创建Rakefile
      创建config.ru
      创建.gitignore
      创建Gemfile
      创建应用程序       创建app / assets / images / rails.png
      创建app / assets / javascripts / application.js
      创建app / assets / stylesheets / application.css
      创建app / controllers / application_controller.rb
      创建app / helpers / application_helper.rb
      创建app / mailers
      创建app / models
      创建app / views / layouts / application.html.erb
      创建app / mailers / .gitkeep
      创建app / models / .gitkeep
      创建配置
      create config / routes.rb
      create config / application.rb
      create config / environment.rb
      创建配置/环境
      create config / environments / development.rb
      create config / environments / production.rb
      create config / environments / test.rb
      创建配置/初始化器
      create config / initializers / backtrace_silencers.rb
      create config / initializers / inflections.rb
      create config / initializers / mime_types.rb
      create config / initializers / secret_token.rb
      create config / initializers / session_store.rb
      create config / initializers / wrap_parameters.rb
      创建config / locales
      create config / locales / en.yml
      create config / boot.rb
      create config / database.yml
      创建db
      创建db / seeds.rb
      创建文件
      创建doc / README_FOR_APP
      创建lib       创建lib /任务
      创建lib / tasks / .gitkeep
      创建lib / assets
      创建lib / assets / .gitkeep
      创建日志
      创建log / .gitkeep
      创造公众       创建public / 404.html
      创建public / 422.html
      创建public / 500.html
      create public / favicon.ico
      create public / index.html
      创建public / robots.txt
      创建脚本
      创建脚本/ rails       创建测试/固定装置
      创建测试/固定装置/ .gitkeep
      创建测试/功能
      创建测试/功能/ .gitkeep
      创建测试/集成
      创建测试/集成/ .gitkeep
      创建测试/单位
      创建test / unit / .gitkeep
      创建test / performance / browsing_test.rb
      create test / test_helper.rb
      创建tmp /缓存
      创建tmp / cache / assets
      创建供应商/资产/ javascripts
      创建供应商/资产/ javascripts / .gitkeep
      创建供应商/资产/样式表
      创建供应商/资产/样式表/ .gitkeep
      创建供应商/插件
      创建vendor / plugins / .gitkeep
         运行捆绑安装
从[https://rubygems.org/]获取gem元数据。
无法加载OpenSSL。 您必须使用OpenSSL支持重新编译Ruby或更改您的源代码 来自' https'的Gemfile到' http'。使用OpenSSL进行编译的说明 使用RVM可以在rvm.io/packages/openssl上找到。

运行rails server时出现以下错误:

/usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs/runtimes.rb:51:in autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs.rb:5:in&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194/gems/execjs-1.4.0/lib/execjs.rb:4:in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in要求&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in要求&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in要求&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194/gems/coffee-rails-3.2.2/lib/coffee-rails.rb:1:in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in要求&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in block (2 levels) in require' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in每个&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in block in require' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in每个&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in require' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/bundler-1.1.5/lib/bundler.rb:119:in要求&#39;
    来自/root/railsdev/simple_cms/config/application.rb:7:in <top (required)>' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:53:in要求&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:53:in block in <top (required)>' <br> from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:50:in点击&#39;
    来自/usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.6/lib/rails/commands.rb:50:in <top (required)>' <br> from script/rails:6:in要求&#39;
    来自script / rails:6:在`&#39;

我该如何解决这个问题?
rvm info提供以下结果

红宝石1.9.3-P194:

系统:     uname:&#34; Linux localhost.localdomain 2.6.32-220.el6.i686#1 SMP Tue Dec 6 16:15:40 GMT 2011 i686 i686 i386 GNU / Linux&#34;     bash:&#34; / bin / bash =&gt; GNU bash,版本4.1.2(1)-release(i386-redhat-linux-gnu)&#34;     zsh:&#34; =&GT;未安装&#34;

RVM:     版本:&#34; rvm 1.14.7(稳定版),作者:Wayne E. Seguin,Michal Papis [https://rvm.io/]"     更新:&#34; 1小时22分29秒前&#34;

红宝石:     翻译:&#34; ruby​​&#34;     版本:&#34; 1.9.3p194&#34;     日期:&#34; 2012-04-20&#34;     平台:&#34; i686-linux&#34;     patchlevel:&#34; 2012-04-20修订版35410&#34;     full_version:&#34; ruby​​ 1.9.3p194(2012-04-20修订版35410)[i686-linux]&#34;

房屋:     gem:&#34; /usr/local/rvm/gems/ruby-1.9.3-p194"     ruby:&#34; /usr/local/rvm/rubies/ruby-1.9.3-p194"

二进制文件:     ruby:&#34; /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby"     irb:&#34; /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb"     gem:&#34; /usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem"     rake:&#34; /usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake"

环境:     路径:&#34; /usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/ usr / local /rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin :/ bin中:/根/箱&#34;     GEM_HOME:&#34; /usr/local/rvm/gems/ruby-1.9.3-p194"     GEM_PATH:&#34; /usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global"     MY_RUBY_HOME:&#34; /usr/local/rvm/rubies/ruby-1.9.3-p194"     IRBRC:&#34; /usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"     RUBYOPT:&#34;&#34;     gemset:&#34;&#34;

2 个答案:

答案 0 :(得分:0)

安装NodeJS并将gem添加到Gemfile中。这应该可以解决运行时问题。

答案 1 :(得分:0)

从Rails 3.1开始,Linux Ubuntu上的开发需要一个JavaScript运行时。 Mac OS X或Windows不需要它。

对于Linux Ubuntu上的开发,最好安装Node.js服务器端JavaScript环境:

sudo apt-get install nodejs

并将其设置在$ PATH。

如果你没有安装Node.js,你需要将它添加到你构建的每个Rails应用程序的Gemfile中:

gem'therubyracer','&gt; = 0.9.9'

source