The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to install gems?

Discussion in 'General Discussion' started by shamabbas, Mar 29, 2011.

  1. shamabbas

    shamabbas Registered

    Joined:
    Mar 29, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi everyone,

    I have uploaded my project which is developed in rails 2.3.8. But in the cPanel rails v=2.3.4 was already installed that my client has done before. But now i want to install rails v=2.3.8. for this new project I have no idea how to do it? I have googled it, tried to search within cPanel available rubygems module also tried to give rails version to install but couldn't figure out. I manualy droped the gems in my /home/name/ruby/gems through File Manager, never worked now here read to add this push command within envirnoment.rb file. But that didn't do the trick also. :-(
    I have been trying but nothing get done yet.

    Please help!!!!! I would greatly appreciate.

    Thanks
     
  2. shamabbas

    shamabbas Registered

    Joined:
    Mar 29, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Re: Ruby cPanel gem

    Hey have you some idea that how can i install gems through cpanel?
    Im a newbie so i have no idea. I tried lots of ways, adding script in environment.rb file and also manualy added gems into /home/name/ruby/gems folder but nothing is working :-(

    Is it must to get shell access? Is it only way to install gems through putty etc.?
    Please help if any idea?
     
  3. shamabbas

    shamabbas Registered

    Joined:
    Mar 29, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi guys,

    I have gone through other threads and also googled it.
    I have added an rails application into my client's cpanel account. My app has rails v= 2.3.8 but the already installed rails version into this account is 2.3.4. I have searched 2.3.8 rails version within modules given and also tried to install by giving name rails(2.3.8) in many ways but nothing worked out.
    I also tried by manually adding all gems in /home/name/ruby/gems and tried both these lines by adding into environment.rb
    ENV['GEM_PATH'] = '/usr/local/lib/ruby/gems/1.8:/home/name/.gem/'
    #ENV['GEM_PATH'] = '/home/name/ruby/gems:/usr/lib/ruby/gems/1.8'
    and also tried to unpack all gems in 'vendor' folder of my project.

    but nothing worked up. :( Please help asap how can i do it?

    I would greatly appreciate.
    Thanks

    shamabbas
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Can you ask your host to install the gem onto your account if it isn't working in cPanel? Normally, you should be able to update a gem or install a gem in cPanel itself, but rails might be restricted due to the issue with installing rails above 2.3.11 on a machine. As such, ask your host to run this command on your account in root SSH:

    Code:
    gem install rails -v=2.3.8
    If you cannot get it to be detected, you really need to be talking to your hosting provider to ask them to install the gem for you.

    Also, please do not post 3 duplicate posts as has been done. I'm going to merge the other 2 posts into this thread.
     
  5. griz

    griz Well-Known Member

    Joined:
    Dec 29, 2001
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the answer on this Tristan, I was able to help a hosting client install gems using your answer.

    If you don't mind, though, I'd like to ask a further question regarding this:

    It seems that even though I was able to install his gems as the root user, he still can't access them.

    Here is his email to me:

    =============================================

    It didn't work like it should. From the command line, I was unable to
    access the new gems.

    I did some looking on the web and I think that it may have something to
    do with the environment variable $LOAD_PATH
    If you type this into the command prompt
    ruby -e 'puts $LOAD_PATH'
    Your will see:
    /usr/lib/ruby/site_ruby/1.8
    /usr/lib/ruby/site_ruby/1.8/x86_64-linux
    /usr/lib/ruby/site_ruby
    /usr/lib/ruby/vendor_ruby/1.8
    /usr/lib/ruby/vendor_ruby/1.8/x86_64-linux
    /usr/lib/ruby/vendor_ruby
    /usr/lib/ruby/1.8
    /usr/lib/ruby/1.8/x86_64-linux

    Of course, NONE of the gems you installed went into any of these
    directories. The gems you installed went into
    /usr/lib/ruby/gems/1.8/gems

    I tried to set the $LOAD_PATH var in the shell, but that doesn't seem to
    work.

    I'm not an expert with bash, so I don't know what to do

    ========================================================

    Any ideas on what he or I can do to make these accessible to him? I know almost nothing about Ruby, so I apologize if this is a really dumb question <-:

    Griz
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Why is he attempting to access gems via the command line? Normally, they are accessed via the script calling them in a browser. What is he trying to do precisely and for what purpose? I simply need more details on exactly what he's doing to answer the question.
     
  7. griz

    griz Well-Known Member

    Joined:
    Dec 29, 2001
    Messages:
    47
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Tristan - here is what my client say's:

    =============================================
    Larry,

    The problem is:

    in a ruby script, the require statement can not find any gems that have
    been installed.
    Example "require 'mysql' " causes an error. Ruby says it can not find
    the gem mysql
    The problem is the $GEM_PATH var doesn't point to anything.

    For some reason, the ruby installation is not configured to see any gems.
    The funny thing is that you can install any gem you want but Ruby can't
    see any of them.

    Keith
    ==========================================================

    Thanks!

    Griz
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Griz,

    Please open up a ticket. In the ticket, the details on what application isn't working and the error message will need to be provided for us to investigate. The method to open up a ticket is to go to WHM > Support Center > Contact cPanel or using the link in my signature.

    If you provide the ticket number here upon submitting one, I will try to grab it myself to investigate it.

    Thanks!
     
Loading...

Share This Page