简体   繁体   中英

Rails 3.2.6 install on Centos6

I did the following steps in order, but have issues running webrick

I have a centos 6 install

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

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

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

It installed all the gems without any issues.

But when I load webrick from the application which was created using
rails new simple_cms -d mysql

Result: create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/images/rails.png
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
create app/controllers/application_controller.rb
create app/helpers/application_helper.rb
create app/mailers
create app/models
create app/views/layouts/application.html.erb
create app/mailers/.gitkeep
create app/models/.gitkeep
create config
create config/routes.rb
create config/application.rb
create config/environment.rb
create config/environments
create config/environments/development.rb
create config/environments/production.rb
create config/environments/test.rb
create config/initializers
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
create config/locales
create config/locales/en.yml
create config/boot.rb
create config/database.yml
create db
create db/seeds.rb
create doc
create doc/README_FOR_APP
create lib
create lib/tasks
create lib/tasks/.gitkeep
create lib/assets
create lib/assets/.gitkeep
create log
create log/.gitkeep
create public
create public/404.html
create public/422.html
create public/500.html
create public/favicon.ico
create public/index.html
create public/robots.txt
create script
create script/rails
create test/fixtures
create test/fixtures/.gitkeep
create test/functional
create test/functional/.gitkeep
create test/integration
create test/integration/.gitkeep
create test/unit
create test/unit/.gitkeep
create test/performance/browsing_test.rb
create test/test_helper.rb
create tmp/cache
create tmp/cache/assets
create vendor/assets/javascripts
create vendor/assets/javascripts/.gitkeep
create vendor/assets/stylesheets
create vendor/assets/stylesheets/.gitkeep
create vendor/plugins
create vendor/plugins/.gitkeep
run bundle install
Fetching gem metadata from [https://rubygems.org/].
Could not load OpenSSL. You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are available at rvm.io/packages/openssl.

I get the following error when running 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 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 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 '
from /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 require'
from /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 require'
from /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 require'
from /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 require'
from /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 each'
from /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 each'
from /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 require'
from /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 require'
from /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 tap'
from /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 require'
from script/rails:6:in `'

How do i fix this?
rvm info gives the following result

ruby-1.9.3-p194:

system: uname: "Linux localhost.localdomain 2.6.32-220.el6.i686 #1 SMP Tue Dec 6 16:15:40 GMT 2011 i686 i686 i386 GNU/Linux" bash: "/bin/bash => GNU bash, version 4.1.2(1)-release (i386-redhat-linux-gnu)" zsh: " => not installed"

rvm: version: "rvm 1.14.7 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]" updated: "1 hour 22 minutes 29 seconds ago"

ruby: interpreter: "ruby" version: "1.9.3p194" date: "2012-04-20" platform: "i686-linux" patchlevel: "2012-04-20 revision 35410" full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]"

homes: gem: "/usr/local/rvm/gems/ruby-1.9.3-p194" ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p194"

binaries: ruby: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby" irb: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb" gem: "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem" rake: "/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake"

environment: PATH: "/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:/root/bin" GEM_HOME: "/usr/local/rvm/gems/ruby-1.9.3-p194" GEM_PATH: "/usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global" MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194" IRBRC: "/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc" RUBYOPT: "" gemset: ""

Install NodeJS and add the gem into the Gemfile. This should fix the runtime problem.

Since Rails 3.1, a JavaScript runtime has been needed for development on Linux Ubuntu. It is not needed for Mac OS X or Windows.

For development on Linux Ubuntu, it's best to install the Node.js server-side JavaScript environment:

sudo apt-get install nodejs

and set it in your $PATH.

If you don't install Node.js, you'll need to add this to the Gemfile for each Rails application you build:

gem 'therubyracer', '>= 0.9.9'

source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM