简体   繁体   中英

JRuby load error

I'm trying to start a Ruby on Rails project on my system. I have installed jruby from this link and Rails from railsinstaller[dot]org
Now, while doing bundle install it was giving me: try bundle install jruby-openssl or try bundle update as jruby-openssl version locked at 0.0.9 in your lock file .
After performing bundle update it keeps showing jruby-openssl related warnings.
And, when I start rails server it is getting struck at this:

cmd屏幕截图

Did anyone else faced similar problem?
What am I doing wrong?
Do I also include gem file and lock file ?
Edit: gem file

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.7'
# Use jdbcmysql as the database for Active Record
gem 'activerecord-jdbcmysql-adapter'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See js#readme for more supported runtimes
gem 'therubyrhino'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: 
gem 'turbolinks'
# Build JSON APIs with ease. 
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development


# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'activeresource', '~> 4.1'

gem 'jruby-openssl'

gem 'faker', :groups => [:development, :test]

gem 'apipie-rails'

gem 'rest-client'

gem 'rest-client-components'

gem 'bootstrap-sass'

gem 'jquery-ui-rails', '~> 5.0', '>= 5.0.5'
gem 'font-awesome-sass', '~> 4.7.0'

gem 'activerecord-session_store'

gem 'active_model_serializers', '~> 0.10.2'

gem 'simple_token_authentication', '~> 1.0' 

gem 'legacy_model_generator', '~> 0.2', :group => :development

gem 'devise', '~> 4.2'

gem 'cancancan', '~> 1.10'

gem "espinita"

gem 'kaminari'

gem 'warbler', '~>2.0', :group => :development

gem 'rspec-rails', :groups => [:development, :test]

gem 'composite_primary_keys'

gem 'rack-cors'
gem 'graphql'
gem 'graphiql-rails'

group :test do
    gem 'database_cleaner'
    gem 'cucumber-rails', :require => false
end

gem 'inifile', '~> 3.0'

gem 'angular_rails_csrf'

gem 'health_check' 

The railsinstaller.org download includes a version of the MRI Ruby runtime. Thus when you are running rails c you are actually running your Rails console in MRI Ruby and not JRuby; hence the error with the jruby-openssl gem.

You can try one of two things:

  • Run the rails command as jruby -S rails c . This will ensure that it runs in Ruby not MRI.
  • Alter your command path so that JRuby's version of the ruby command has a higher priority than the MRI one. (Sorry, I can't help you here, because I don't speak Windows.)

On Linux and MacOS you could alternatively use a Ruby manager such as rvm or rbenv . I don't know if there is a similar tool that works on Windows.

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