after I deploy with capistrano to a new server I see:
/shared/bundle/ruby/1.9.1/gems/
I don't even have ruby 1.9.1 installed on the server. and if i run: ruby -v
it returns 1.9.3
but in all of capisrtano actions i keep seeing 1.9.1
why is that? and how can i stop it?
thanks
Don't worry. Ruby 1.9.1 to 1.9.3 is using that path by default. It doesn't necessarily mean you are using the wrong Ruby.
Related
I put the ruby version 2.3.1 in my gemfile, but Heroku keeps using 2.4.4. How do I make it so Heroku recognizes the version specified in the gemfile?
try to use the heroku console by typing heroku run "ruby -v" and give command to use which version of ruby you want him to
You are probably on the heroku-18 stack which it the current default. Please note that Ruby 2.3.x is not available on this stack.
You have two options:
Update your Ruby version to a more recent version or
Downgrade Heroku to use an older stack.
Given that the maintenance phase for Ruby 2.3.x has ended anyway I would suggest updating our application to use at least Ruby 2.4.4.
I am using Ruby version 2.2.3 which I've upgraded from 2.1.5. The problem is when I try to execute any Rails command it won't execute and give me this error
the rails' command exists in these ruby versions 2.1.5
So when I switched back to my previous version by rbenv global 2.1.5, it is working again. Can anyone tell me whats going on here? Why I can't do anything with newer version of ruby?
Maybe try to do a gem install rails with your new version.
So I'm a rails developer familiar with Rails 3 and 4. I'm taking on a Rails 1.1.2 project, and the first problem I'm having is getting the server running.
I'd really love some help figuring out what I'm missing setting up the environment. When I run script/server, I get:
-bash: script/server: /Users/michael/.rvm/gems/ruby-1.9.3-p545: bad interpreter: Permission denied
This is after noting that at the top of the script/server file, there's an opportunity to define the location of the ruby install with a ruby comment:
#!/Users/michael/.rvm/gems/ruby-1.9.3-p545
At least, this is how I understand it. What should this comment point to? Does this look correct? I've installed ruby 1.9.3 using rvm and installed rails V 1.1.2 through sudo gem install rails. Everything seemed to work fine.
Is this some kind of bash permissions issue? I really don't understand what's going on. Any help would be appreciated!
I believe a rails project that old will require Ruby 1.8.7, so you should start with an older version of Ruby just to be sure. Once you get it running with the older ruby version, you can try 1.9 again, but trying it with 1.8.7 should help you out a bit. Your shebang should be able to do this though:
#!/usr/bin/env ruby
It needs the path of the ruby interpreter, which can be obtained dynamically via the above line.
After upgrading a Rails application to use Ruby 2.0.0 (from 1.9.3), I started receiving this error when attempting to deploy to Heroku via rake <stage> deploy.
Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 (Bundler::RubyVersionMismatch)
It also seems to cause this error, (but I can run the Heroku commands manually without the heroku_san helpers, so authorization is not the issue).
Expected(200) <=> Actual(401 Unauthorized)
I updated the gems to the latest version, and also updated the Heroku Toolbelt.
I found this pull request and patched my version, but the error persisted.
How do I solve this (on both Ubuntu & OSX)?
Other info:
Ubuntu 12.04 LTS x64
Rails 3.2.13
Ruby 2.0.0-p247
heroku-api-0.3.15
heroku_san-4.0.8
heroku-toolbelt/2.41.0 (x86_64-linux)
rvm 1.22.10
The solution for me on Ubuntu was to modify
/usr/local/heroku/bin/heroku
And change the shebang line to
#!/usr/bin/env ruby
Thanks goes to Pivotal Labs for this.
(I don't use a Mac.)
Another issue I found with this error (1.9.2 not 1.9.3) is having BUNDLE_GEMFILE env variable set on heroku which causes heroku ruby build pack to freak and default to 1.9.2.
TLDR: How do I force a rails app to use the correct ruby interpreter?
Hello,
Something hosed parts of my Ruby 1.9.2p290 install (certain classes just went missing one day), so I removed it and attempted to reinstall the environment.
I'm running on Snow Leopard.
Ruby 1.9.2 was installed from source. (I tried to install via MacPorts and it would fail). I am not keen on RVM as I use bundler and I seem to recall some problems with how bundler and RVM interact, though from what I can tell RVM works.
After reinstalling a few gems I noticed they were being placed in a gem folder for Ruby 1.8. "This is weird," I thought.
Starting up the rails app, I notice a lot of weird exceptions being thrown regarding syntax. After printing RUBY_VERSION to stdout, I noticed that the Rails app is running 1.8.7.
which ruby shows only one ruby interpreter:
$ which ruby
/usr/bin/ruby
$ /usr/bin/ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
If I open up Activity Monitor, the ruby process from the Rails app lives at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby, which I believe is the ruby interpreter that OSX shipped with.
I haven't found any information on completely purging Ruby from OSX. I would love to do that then simply install ruby from source.
It seems there are two problems:
Rails is running a ruby interpreter that I have no idea how it is calling, when I need it to run the 1.9.2 interpreter installed from source
gems are being installed in a 1.8 folder, I suspect because gem thinks its running under 1.8
How do I fix this?
Thank you,
Tom
I guess the best way to overcome this issue is using rvm to handle your Ruby and Rails environments through 'gemset's.
I had the same issue and I use gemsets now without a problem.
This is the article which I got things working:
http://stjhimy.com/posts/10-five-quick-steps-to-set-up-rvm-with-rails-2-and-rails3