I use Pow and powify gem with my rails project.
Now I try to upgrade my ruby version (from 1.9.3 to 2.0.0, I use RVM)
When I switch ruby version, install all gem dependencies, I make sure that app works fine by running rails s
and visiting localhost:3000
Previosly I browse my app by visiting http://my_app.dev
with pow. After upgrade this url doesn't work due to error Bundler::RubyVersionMismatch: Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
What I tried:
This error still exists. By the way, I have another rails app, that uses ruby 2.0 initially and works with pow ok.
Create an file called .powrc
in your projects root directory. Copy and paste the content below to your file.
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
if [ -f ".ruby-gemset" ]; then
rvm gemset use --create `cat .ruby-gemset`
fi
fi
This will look to your ruby environment files and select the correct version from it. If this won't work on your first try then make sure you have an .rvmrc
or .ruby-version
file in your root directory for the project.
And don't forget to touch tmp/restart.txt
to restart your application.
Source: https://gist.github.com/nbibler/5307941
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With