You are not logged in.
If you're a WebFaction customer the best way to install gems for your Rails application is to install Ruby and RubyGems in your home directory and update your application of type Rails' autostart.cgi to use your local installation of Ruby. The procedure looks something like this:
# Install Ruby cd mkdir ruby1.8/ ruby1.8/src/ cd ruby1.8/src/ wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.6-p110.tar.gz tar fxz ruby-1.8.6-p110.tar.gz cd ruby-1.8.6-p110/ ./configure --prefix=$HOME/ruby1.8/ make make install cd ../../ rm -fr src/ # Add ~/ruby1.8/bin/ and ~/ruby1.8/lib/ruby/gems/1.8/bin/ to your PATH. cd echo "export PATH=$HOME/ruby1.8/bin/:$HOME/ruby1.8/lib/ruby/gems/1.8/bin/:\$PATH" >> .bash_profile source .bash_profile # Install RubyGems cd mkdir temp/ cd temp/ wget http://rubyforge.org/frs/download.php/20989/rubygems-0.9.4.tgz tar fxz rubygems-0.9.4.tgz cd rubygems-0.9.4/ ruby setup.rb config ruby setup.rb install cd rm -fr temp/ # Update RubyGems gem update --system # Install the Mongrel, MySQL, and PostgreSQL gems. export POSTGRES_INCLUDE=/usr/local/pgsql/include/ export POSTGRES_LIB=/usr/local/pgsql/lib/ gem install --platform=ruby mongrel mysql postgres
At this point you should install every gem that your Rails application needs.
# Replace XXX with the name of your application of type Rails in the following command. cd ~/webapps/XXX/ # Update autostart.cgi to use your installation of Mongrel. sed -i "s|/usr/local/bin/mongrel_rails|$HOME/ruby1.8/lib/ruby/gems/1.8/bin/mongrel_rails|" autostart.cgi # Restart Mongrel kill `cat log/mongrel.pid` ./autostart.cgi
That's it, now you can install gems using "gem install (Gem Name)".
Hope it helps. ![]()
Last edited by IAIHMB (2008-03-26 01:55:11)
Offline
Hi - I got a little bit stuck following these instructions:
I got ruby installed, I added the paths, I downloaded Gems, and now Gems is stuck.
[seanharper@web1 rubygems-1.1.0]$ pwd
/home2/seanharper/tmp/rubygems-1.1.0
[seanharper@web1 rubygems-1.1.0]$ ~/ruby1.8/bin/ruby setup.rb
./lib/rubygems.rb:10:in `require': no such file to load -- thread (LoadError)
from ./lib/rubygems.rb:10
from setup.rb:19:in `require'
from setup.rb:19
[seanharper@web1 rubygems-1.1.0]$
Any ideas?
[seanharper@web1 rubygems-1.1.0]$ $PATH
-bash: /home2/josh/git_app/bin:/home2/seanharper/ruby1.8/bin/:/home2/seanharper/ruby1.8/lib/ruby/gems/1.8/bin/:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home2/seanharper/bin:
Offline
Sean,
I su'd into your account and ran Step 1 of the procedure here:
https://help.webfaction.com/index.php?_ … p;nav=0,21
No errors, so I think you're good to go.. just pick up at Step 2
Regards,
Offline
@IAIHMB
Im trying to set up Ozark (http://github.com/brennandunn/ozark/tree/master). Have successfully installed Ruby, all the required gems and mongrel but when I try to restart mongrel:
[vomitols@web22 ozark]$ kill `cat log/mongrel.pid`
cat: log/mongrel.pid: No such file or directory
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Could you please take a look?
Didn't migrate the db yet. Waiting for this step.
All the best,
Bernardo.
Offline
@seanf
thank you!
Offline
@seanf
Now the site is restarting over and over again.
Offline
I went with 1.8.6 (patch level 110) of ruby since that appears to be what webfaction is already using (patch level 0), didn't want to shake the boat too much, not convinced it matters, but anyway,
I'm getting stuck hereabouts:
[conner@web41 ~]$ gem update --system
Updating RubyGems
Bulk updating Gem source index for: http://gems.rubyforge.org/
Updating rubygems-update
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/lib/ruby/gems/1.8/cache/rubygems-update-1.3.3.gem
[conner@web41 ~]$ export POSTGRES_INCLUDE=/usr/local/pgsql/include/
[conner@web41 ~]$ export POSTGRES_LIB=/usr/local/pgsql/lib/
[conner@web41 ~]$ gem install --platform=ruby mongrel mysql postgres
Bulk updating Gem source index for: http://gems.rubyforge.org/
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /usr/local/lib/ruby/gems/1.8/cache/fastthread-1.0.7.gem
[conner@web41 ~]$ gem -v
1.1.1
[conner@web41 ~]$ which gem
~/ruby1.8/bin/gemIs there some environment variable i should be setting to keep it inside my space?
Offline
[conner@web41 ~]$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.1.1
- RUBY VERSION: 1.8.6 (2007-03-13 patchlevel 0) [i686-linux]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.orga lot of that looks wrong... i'll keep plugging away at it
Offline
apparantly running 'source .bash_profile' wasn't enough, a logout/login seemed to make everything happy.
'which gem' gave me my install of gem, but when interacting with it any other way i got the usr/local install
Offline
conner wrote:
apparantly running 'source .bash_profile' wasn't enough, a logout/login seemed to make everything happy.
'which gem' gave me my install of gem, but when interacting with it any other way i got the usr/local install
That's strange... first time I've heard of 'source .bash_profile' not working. But, glad you were able to sort it out ![]()
Offline
Not to keep spamming this thread, but I've got another problem: mysql failed to install
[conner@web41 ~]$ gem install --platform=ruby mongrel mysql postgres
Building native extensions. This could take a while...
Building native extensions. This could take a while...
Successfully installed fastthread-1.0.7
Successfully installed cgi_multipart_eof_fix-2.5.0
Successfully installed mongrel-1.1.5
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/home/conner/ruby1.8//bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/conner/ruby1.8//bin/ruby
--with-mysql-config
--without-mysql-config
--with-mysql-dir
--without-mysql-dir
--with-mysql-include
--without-mysql-include=${mysql-dir}/include
--with-mysql-lib
--without-mysql-lib=${mysql-dir}/lib
--with-mysqlclientlib
--without-mysqlclientlib
--with-mlib
--without-mlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-zlib
--without-zlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-socketlib
--without-socketlib
--with-mysqlclientlib
--without-mysqlclientlib
--with-nsllib
--without-nsllib
--with-mysqlclientlib
--without-mysqlclientlib
Gem files will remain installed in /home/conner/ruby1.8/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
Results logged to /home/conner/ruby1.8/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.outMy environment:
[conner@web41 ~]$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.3
- RUBY VERSION: 1.8.6 (2007-09-23 patchlevel 110) [i686-linux]
- INSTALLATION DIRECTORY: /home/conner/ruby1.8//lib/ruby/gems/1.8
- RUBY EXECUTABLE: /home/conner/ruby1.8//bin/ruby
- EXECUTABLE DIRECTORY: /home/conner/ruby1.8//bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/conner/ruby1.8//lib/ruby/gems/1.8
- /home/conner/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
[conner@web41 ~]$ echo $PATH
/home/conner/ruby1.8/bin/:/home/conner/ruby1.8/lib/ruby/gems/1.8/bin/:/home/conner/webapps/gitosis/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/conner/binI first got an error for mongrel and mysql, fastthread needs 1.1.2 or higher of rubygem. Couldn't seem to upgrade it using the traditional means, so I used the update rubygem plugin to bring me up, which left me here.
Offline
woot
that works
thank you!
Offline