I am trying to use wicked_pdf and wkhtmltopdf, but everytime I run it I get the following error.
RuntimeError: Error: Failed to execute: ["/home/daveomcd/.rvm/gems/ruby-2.3.4/bin/wkhtmltopdf", "-q", "--encoding", "utf-8", "--disable-javascript", "--disable-internal-links", "--disable-external-link...
I think the issue is that it's executing from the /.rvm/gems/ruby-2.3.4/.. directory instead of my /.rvm/gems/ruby-2.5.1/.., but I can't seem to get it to switch tot he 2.5.1 directory. I'm using rvm and it's currently set to 2.5.1 as seen here. Where else would I need to check to change this? I've also uninstalled and install all of my gems and bundler, but no luck.
daveomcd#mcdonald-PC9020:~/rails_projects/bane$ rvm list
rvm rubies
ruby-2.3.4 [ x86_64 ]
=* ruby-2.5.1 [ x86_64 ]
# => - current
# =* - current && default
# * - default
Oddly, I figured out the issue shortly after posting. My issue was I was using it in conjuction with Sidekiq. I needed to kill my sidekiq process and then restart the process. I guess it had started up when I was on a separate project. Thanks to anyone that took a look at my question.
Related
I am having problems with Ruby. When I try to install addressable, I get told I need ruby 1.9.0 or higher, but as you can see from my rvm list command I run 2.3.1.
Does anyone have any tips? am I doing something wrong? I've tried running the clean up, and reinstalling but I get the same error.
Any tips you can provide would be great! Thanks!
root#server1 [/]# rvm list
rvm rubies
ruby-2.3.1 [ x86_64 ]
# Default ruby not set. Try 'rvm alias create default <ruby>'.
# => - current
# =* - current && default
# * - default
root#server1 [/]# gem install addressable -v '2.4.0'
ERROR: Error installing addressable:
addressable requires Ruby version >= 1.9.0.
root#server1 [/]#
First run rvm use ruby-2.3.1 then gem install addressible.
To not have to run this command first, run rvm alias create ruby-2.3.1. You may have to run bash after that to load the changes. Sometime's it's needed to either run /bin/bash --login or change the terminal preferences to login shell in order for RVM commands to work.
I think you may be using the "system" ruby. This will be obvious when you run ruby -v. It is also evidenced by the fact that your rvm list output does not list a Ruby as the "current" Ruby. So rvm will have a newer Ruby, but it will not be used.
It's possible that creating the default Ruby for rvm will result in that Ruby being loaded whenever you open a terminal.
Also, the terminal needs to be a "login shell", but if this is a problem you should see a message to that effect.
So I suggest doing the following, which should only need to be done once:
rvm default ruby-2.3.1
...then opening a new terminal and seeing if your gem command works correctly there.
I am having trouble launching my application in the server because of the following error:
/home/blabla/.rvm/gems/ruby-2.1.0/bin/ruby/2.1.0/bin/unicorn", "-E", "beta", "-c", "/var/www/testenvir/releases/20141117005244/config/unicorn.rb", "-D", {16=>#<Kgio::UNIXServer:fd 16>}] (in /var/www/testenvir/releases/20141121053734)
/home/blabla/.rvm/gems/ruby-2.1.0#global/gems/bundler-1.6.3/lib/bundler/definition.rb:390:in `validate_ruby!': Your Ruby version is 2.1.0, but your Gemfile specified 2.0.0 (Bundler::RubyVersionMismatch)
The error is self descritive, but i don't know how to fix it since i have in my Gemfile script:
ruby '2.0.0'
And in my capistrano deployment script:
set :rvm_ruby_string, 'ruby-2.0.0-p353'
set :bundle_dir, "/home/blabla/.rvm/gems/ruby-2.0.0-p353/bin"
In my server, i set my environment variables as following:
rvm use ruby-2.0.0-p353
And the output of env RAILS_ENV=testenvir bundle exec ruby -v is :
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
I could verify by connecting through a new terminal that rvm listproduces :
=* ruby-2.0.0-p353 [ x86_64 ]
ruby-2.1.0 [ x86_64 ]
Finally my crashing command is defined in the eye script that tries launching the following command:
bundle exec unicorn -E #{RAILS_ENV} -c #{working_dir}/config/unicorn.rb -D
I verified that #{working_directory} and #{RAILS_ENV} are correct, so i thought about hardcoding ( as a first step), the paths of bundleand unicorn, since they are the one taken from the 2.1.0 instead of the 2.0.0-p353 ( The error that i get in unicorn.log... ), but it didn't work ( crashed with another error...)
I also checked $PATH, $GEM_HOME, $GEM_PATH and $RUBY_VERSION, and they were all pointing to the version 2.0.0-p353. In fact, i did a printenv and looked for a potential variable with ruby-2.1.0 assigned to it, but i found none !
I checked all files of my application to wether i am assigning ruby-2.1.0 somewhere anyhow, but i didn't find any reference to that. All of them were set to ruby-2.0.0-p353.
My question is :
Is there another place that i am missing where should i specify my desired ruby version ? How should i set my ruby version in the server rather that what i did ?
Thanks!
UPDATE:
rvm current
ruby-2.0.0-p353
rvm gemset list
gemsets for ruby-2.0.0-p353 (found in /home/deployer/.rvm/gems/ruby-2.0.0-p353)
=> (default)
global
A little late but could help others who are experiencing the same problem. I´m using rolling restart and what helped me was this comment which I have in my config/unicorn.rb file
# If you roll off old code from your app servers (i.e. the way chef, capistrano,
# basically anyone does it) you need to make sure Unicorn is not looking for
# the Gemfile it was originally started with. It's really important that after
# change you stop/start unicorn after first redeploy.
# After that the "before_exec" block will go in memory and
# wait for the next deploy!
before_exec do |server|
ENV['BUNDLE_GEMFILE'] = "#{root}/Gemfile"
end
So then I ran
/etc/init.d/unicorn-myapp stop
/etc/init.d/unicorn-myapp start
and unicorn picked up the new ruby version.
I am trying to fix my RVM. Last week everything was working fine but today for some reason my rails commands are not working. For example, if I try:
rails new blog
I get this error:
.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- rails/version (LoadError)
Is this because my ruby version is outdated? does anyone know how I could fix this? I looked all over and only found the rvm get stable command however that did not fix my issue. Thank you to anyone that knows what is going on here.
Sorry for the bad formatting, here you go.
here is ruby -v:
`
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
here is the error I get with rails -v:
/home/tyrel/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require': cannot load such file -- rails/version (LoadError)
here is rvm list:
rvm rubies ruby-1.9.3-p448 [ x86_64 ] ruby-1.9.3-p484 [ x86_64 ] =* ruby-2.0.0-p247 [ x86_64 ] ruby-2.0.0-p353 [ x86_64 ] # => - current # =* - current && default # * - default
thanks for the help but upon further research I found what I needed to do.
First I ran:
gem pristine --all
Then I found another post on here that recommended trying this:
You need to run the follow
user$ source ~/.rvm/scripts/rvm
then run this
user$ type rvm | head -n 1
and if you get
rvm is a function
the problem is solved.
You also need to run user$ rvm requirements to see dependency requirements for your operating system
Source: https://rvm.io/rvm/install/
I forget mention that you need to put this code into you ~/.bashrc or ~/.zshrc file and you will not need to write this code again. Cheers! -Jorge Garcia
After all that my RVM was fixed, and I can use my rails new projectname command.
Thanks for all the help community!!!<3
I have been using RVM for almost a year now without a problem, but suddenly it started to behave odd a day ago. First of all I wasn't able to enter the Rails console or server - it just told me that it couldn't be found anywhere. After running bundle install it fetched all Gems again as if none of them had been installed previously. This worked until I restarted my machine - after that I had to bundle again.
I am not aware of changing anything in the system that could trigger this kind of behaviour. Did anybody experience something like it before?
I am running the latest stable RVM release on Ubuntu 13.10
Try the following:
rvm list
You should see something like this:
ruby-2.0.0-p0 [ x86_64 ]
=* ruby-2.1.0-preview1 [ x86_64 ]
The =* indicates ruby-2.1.0-preview1 is my current and default ruby version.
Try switching to another ruby version, in my case:
rvm use ruby-2.0.0-p0
the rvm list command should now yield ( => means current, * default):
=> ruby-2.0.0-p0 [ x86_64 ]
* ruby-2.1.0-preview1 [ x86_64 ]
What's happening with you is probably that rvm is switching versions when you reboot. You might want to set the version you want to use as default, in my case:
rvm use ruby-2.0.0-p0 --default
rvm list
=* ruby-2.0.0-p0 [ x86_64 ]
ruby-2.1.0-preview1 [ x86_64 ]
I have ruby 2.0.0 and rails 4 , up until today I always was able to do rails new . and get a project running.
But today when I tried to run it I got
/usr/bin/rails:22:in `load': cannot load such file -- /Users/potter/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.0/bin/rails (LoadError)
from /usr/bin/rails:22:in `<main>'
potters-MacBook-Pro:test potter$ rvm list
rvm rubies
ruby-1.9.3-p448 [ x86_64 ]
=* ruby-2.0.0-p247 [ x86_64 ]
# => - current
# =* - current && default
# * - default
I have no idea what changed , any suggestions ?
The permissions to my /User/<mac username>/.rvm changed for some reason from 755 to 744. I think it might have to do due to an installation of rjb.
fixed with chmod
It seems like you already have ruby and rails installed in your system (/usr/bin/rails). I think you should clean all current rails and reinstall it from scratch