Using Ruby 2.0 on Amazon OpsWorks

时光总嘲笑我的痴心妄想 提交于 2019-12-09 06:22:20

问题


I'd like to use Ruby 2.0 on Amazon OpsWorks, so I'm trying the following:

  • Choose custom cookbooks and set them to my fork of https://github.com/aws/opsworks-cookbooks
  • Update all version numbers here https://github.com/aws/opsworks-cookbooks/blob/master/ruby/attributes/ruby.rb to 2.0 values.

This doesn't seem to have any effect, though.

  • Do custom cookbooks override their built in counterparts?
  • Does OpsWorks use the Ruby recipe from the cookbook for basic Ruby setup?
  • The same question applies to Nginx too - can I control versions and settings by changing my fork for the cookbooks?

回答1:


OpsWorks now fully supports Ruby 2.0, in Layer settings you can specify the version of Rails, Bundler and Rubygems.




回答2:


Opsworks already has support for Ruby 2.0, it's just not exposed through the UI. However, you can easily enable it by simply passing in the following custom JSON

{
  "opsworks" : {
    "ruby_version" : "2.0.0"
  }
}

That's it! No need to install any custom packages or anything.




回答3:


OpsWorks distributes some of their packages their own and Ruby 2.0 is not part of it right now. If you want to use Ruby 2.0 you have to install it your own.

Best, Daniel




回答4:


Deploy ruby 2.0 with rails 4.0 on AWS opsworks

update stack json

{ "opsworks" : { "ruby_version" : "2.0.0" } }

update the rails app layer.

in your 'Rails App Layer', make sure you upgraded rubygem version to be 2.X (default is 1.8.24)

otherwise you will getting the require mysql2/mysql.rb [loadError] :(

LoadError: cannot load such file -- mysql2/mysql2



来源:https://stackoverflow.com/questions/16649813/using-ruby-2-0-on-amazon-opsworks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!