amazon ec2 - Deploy ruby 2.0 and rails 4.0 on EC2 with beanstalk -
i deployed rails 4 app on ec2 beanstalk. since there no ruby 2.0 , rails 4.0 container available currently, installed ruby 2.0 , rails 4.0 on instance follow post: installing ruby 2.0 , rails 4.0.0beta on aws ec2
but still got error passenger:
your ruby version 1.9.3, gemfile specified 2.0.0 (bundler::rubyversionmismatch)
i cd /var/app/current, run
$ ruby -v ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
is there missed?
thanks
some info updates:
$ bundle /usr/local/rvm/gems/ruby-2.0.0-p195/bin/bundle $ gem env rubygems environment: - rubygems version: 2.0.3 - ruby version: 2.0.0 (2013-05-14 patchlevel 195) [x86_64-linux] - installation directory: /usr/local/rvm/gems/ruby-2.0.0-p195 - ruby executable: /usr/local/rvm/rubies/ruby-2.0.0-p195/bin/ruby - executable directory: /usr/local/rvm/gems/ruby-2.0.0-p195/bin - rubygems platforms: - ruby - x86_64-linux - gem paths: - /usr/local/rvm/gems/ruby-2.0.0-p195 - /usr/local/rvm/gems/ruby-2.0.0-p195@global - gem configuration: - :update_sources => true - :verbose => true - :backtrace => false - :bulk_threshold => 1000 - remote sources: - https://rubygems.org/
elastic beanstalk starts passenger using script @ /etc/init.d/passenger
, , don't think gets same environment variables bash user. see mean, go /etc/init.d/passenger
, , output environment variables log file follows:
# /etc/init.d/passenger . /opt/elasticbeanstalk/support/envvars env > /var/log/debug-rvm.log
then, execute
$> sudo service passenger restart $> cat /var/log/debug-rvm.log
to see of environment variables available @ point passenger processes started.
the startup script gives clues how these variables initialized. in particular, learnt can edit /opt/elasticbeanstalk/support/envvars.d/appenv
add own custom environment variables. might able edit path
variable , load rvm using file.
i added answer question referenced, might useful purposes.
alternative
alternatively, can symlink /usr/bin/ruby
ruby 2.0, think getting right can quite tricky, because bypassing rvm. hope helps.
$> ls -l /usr/bin/ruby lrwxrwxrwx 1 root root 16 jun 7 14:57 /usr/bin/ruby -> /usr/bin/ruby1.9
Comments
Post a Comment