Professional Documents
Culture Documents
AUG
APR
18
19
search
How
with
SQLite3
How to
to install
install Ruby
Ruby on
on Rails
Rails 43.2
with
MySQLononDebian/Ubuntu
Debian/Ubuntu
This is the way I managed to install Ruby on Rails 4 with SQLite3 on Debian Wheezy / Ubuntu 12.04
This is the way I managed to install Ruby on rails 3.2 with MySQL on Debian/Ubuntu.
(but it is valid also for previous versions of Ubuntu 11.04, 10.10, 10,04 etc) . I've chosen to install all
the packages manually in a way that you can exactly know what you're installing and where, without
Other articles you may be interested in:
using rbenv or RVM.
ROR with SQLite3 for Ubuntu 11 .10 (the easiest way to install and use ror)
ROR with SQLite3 for Fedora 15
Pay attention: if you had already installed Ruby on rails with SQLite3 and you just want to add mysql
Other articles you may be interested in:
database you can skip some steps, but make sure to install the required libraries.
ROR with MySQL for Ubuntu
1. INSTALL THE NEEDED LIBRARIES
Type the following command in the console:
1. INSTALL SOME LIBRARIES
sudo apt-get install zlib1g zlib1g-dev build-essential openssl libssl-dev libmysqlclient18
Open the console and run the following comand as super user (su -):
libmysqlclient-dev libyaml-dev
apt-get install zlib1g zlib1g-dev build-essential sqlite3 libsqlite3-dev openssl libssl-dev libyaml2. DOWNLOAD AND INSTALL RUBY 1.9.3
dev libreadline-dev libxml2-dev libxslt1-dev
Send feedback
pdfcrowd.com
Send feedback
pdfcrowd.com
Put the console in myapp folder (cd yourappname) and run: $ rake db:create
in order to create the databases test.sqlite3 and development.sqlite3: (you can see them in db
folder).
!!! If you receive some error jump to the session : 9. !! COMMON ISSUES THAT MIGHT OCCUR !!!
6. RUN YOUR RAILS APP
Put the console in myapp folder and run $ rails server
Open the browser
http://localhost:3000
and you should see the Ruby on Rails: welcome page;-)
pdfcrowd.com
I suggest you to continue the ROR learning on the official documentation, in particular on the getting
started page.
Running rake db:create or rake db:migrate you could get the error: uninitialized constant
Rake::DSL. The solution is to put in the first line of your Rakefile: require 'rake/dsl_definition'
In the browser at localhost:3000 you could get the error: "no such file to load -- openssl".
The solution is to go through the installation directory of ruby: ruby-1.9.2-p180/ext/openssl and
run:
ruby extconf.rb
make
sudo make install
open in browser PRO version
pdfcrowd.com
Running rake db:create the first time could generate this error:
rake aborted!
Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of
available runtimes.
The error should be fixed adding in the Gemfile (in the root folder of your app) the lines:
gem 'execjs'
gem 'therubyracer'
and run the comand bundle install (as super user)
Put again the console in myapp folder and run: $ rake db:create
I hope that everything went the right way, check the comments below, feel free to post comments or
issues, please provide me a feedback ;-) AND DON'T FORGET TO +1 !
APR
19
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
socket: /var/run/mysqld/mysqld.sock
9. CREATE THE BLANK DATABASE
Start the mysql database using: sudo service mysql start
Put the console in myapp folder and run: $ rake db:create
Check the step 12 if you get an error here.
in order to create the databases myapp_test and myapp_development.
If creates the db is correctly creates, it replies with anything...
It could be useful to check if the db is created or not: do like this:
$ mysql -u root -p // open mysql console
$ Enter password: type-your-password
mysql> show databases;
pdfcrowd.com
I suggest you to continue the ROR learning on the official documentation, in particular on the getting
started page.
pdfcrowd.com
In the browser at localhost:3000 you could get the error: "no such file to load -- openssl".
The solution is to go through the installation directory of ruby: ruby-1.9.2-p180/ext/openssl and
run:
ruby extconf.rb
make
sudo make install
I hope that everything went the right way, check the comments below, feel free to post comments or
issues, please provide me a feedback ;-) AND DON'T FORGET TO +1' !
open in browser PRO version
pdfcrowd.com
OCT
11
Here's how I compiled and installed TORCS on a linux os (Debian in my case), using a 64bit processor.
Install the required libraries
sudo apt-get install build-essential libxmu-dev libxmu6 libxi-dev libxine-dev libalut-dev freeglut3
freeglut3-dev cmake libogg-dev libvorbis-dev libxxf86dga-dev libxxf86vm-dev libxrender-dev libxrandrdev zlib1g-dev libpng12-dev
PLIB 1.8.5
download PLIB 1.8.5 from here
configure the package with the following parameters(only for 64 bit cpu)
./configure CFLAGS="-O2 -m64 -fPIC" CPPFLAGS="-O2 -fPIC" CXXFLAGS="-O2 -fPIC"
LDFLAGS="-L/usr/lib64"
sudo make install
OpenALsoft 1.13
open in browser PRO version
pdfcrowd.com
RUN TORCS
just type "torcs" in the console.
If the music/sound don't work, try with typing "padsp torcs" in the console.
Posted 11th October 2012 by Manuele Dones
Labels: debian, Linux, 64bit, source, 64, torcs, compile
pdfcrowd.com
OCT
11
Here is the way i managed to compile and install Speed Dreams on a Linux OS (Debian in my case)
Download the latest version of Speed Dreams from the official sourceforge Speed Dreams project.
Have a look here for the pre-requisites:
Working OpenGL Driver and header files / associated libraries
SDL 1.2
PLIB 1.8.3 / 4 / 5
OpenAL soft 1.5
ALUT 1.1
libpng
zlib
jpeg
ENet 1.2
X RandR
Install the required libraries:
sudo apt-get install build-essential libxmu-dev libxmu6 libxi-dev libxine-dev libalut-dev freeglut3
freeglut3-dev cmake libogg-dev libvorbis-dev libxxf86dga-dev libxxf86vm-dev libxrender-dev libxrandrdev zlib1g-dev libpng12-dev libsdl1.2-dev libenet-dev
PLIB 1.8.5:
download from here the latest version.
pdfcrowd.com
Speed Dreams:
create a folder
Download the following source files from here
speed-dreams-src-base-<version>.tar.xz
speed-dreams-src-hq-cars-and-tracks-<version>.tar.xz
open in browser PRO version
pdfcrowd.com
speed-dreams-src-more-hq-cars-and-tracks-<version>.tar.xz
speed-dreams-src-wip-cars-and-tracks-<version>.tar.xz
speed-dreams-src-unmaintained-<version>.tar.xz
put the files in a folder
uncompress them with: for
mkdir build
cd build
cmake -D OPTION_OFFICIAL_ONLY:BOOL=ON ..
make
sudo make install
SEP
15
pdfcrowd.com
pdfcrowd.com
./ut2004_3369-english-midway.dvd-3.run
pdfcrowd.com
pdfcrowd.com
5) After entering the CD-KEY (I own an original copy) and clicking on Continue, the wizard will start
extracting files from the DVD.
pdfcrowd.com
On first it seems to be freezed, but after some minutes the installer will start copying the
files.
pdfcrowd.com
If you're sure that the installation process is stuck, I've found an alternative way: keep
reading
6) Come back to the console and type on your keyboard
wizard!
7) Force Quit the wizard and a new window should appear! Sometimes the new window appear only if I
close the console... Don't ask me why...
pdfcrowd.com
pdfcrowd.com
pdfcrowd.com
9) It will ask to mount the dvd...Just put the dvd in your player and complete the installation!
10) Personal Note: I need to run the game with padsp ./ut2004 in order to listen the music/sounds.
open in browser PRO version
pdfcrowd.com
I hope this tutorial has helped you. If you found it useful don't forget to +1! Comments are
greatly appreciated!
Posted 15th September 2012 by Manuele Dones
Labels: how to install ut2004, midway, UT2004, Linux, editor's choice, Unreal Tournament 2004, Ubuntu
SEP
pdfcrowd.com
JDK
Unreal Tournament 2004, the game
NetBeans
Pogamut 3.3.0
2) Install JDK
There are several ways to install a JDK: my suggestion is to download the JDK from the official website.
Unzip it somewhere.
FOR A UBUNTU SYSTEM:
Update the file /etc/environment like this:
PATH="/usr/loc....[etc]:/home/manuele/software/jdk1.7.0_03/bin"
JAVA_HOME="/home/manuele/software/jdk1.7.0_03"
where /home/manuele/software/jdk1.7.0_03 is the unzipped jdk folder.
Save the file.
Reboot the system.
open in browser PRO version
pdfcrowd.com
3) Install NetBeans
Download it from the official website. I downloaded the last version (7.2) , version called "ALL".
Install it, typing on your Linux console:
chmod +x netbeans-7.2-ml-linux.sh
./netbeans-7.2-ml-linux.sh
4) Install Pogamut
Download it from the official website. Download the standalone version: it's a java file, so in order to
open in browser PRO version
pdfcrowd.com
pdfcrowd.com
During the installation of Pogamut you should deselect the "UT2004Patch" if you get some kind of
errors...
When it asks for the netbeans folder, you should choose the netbeans-7./nb folder.
open in browser PRO version
pdfcrowd.com
At the end you will get this error, but it should not be a big trouble...
pdfcrowd.com
pdfcrowd.com
I'm noticing that Pogamut didn't create any Maven folder... Anyway, Netbeans has a bundled version of
Maven, but you could download the latest version from the website... Remember to update the Maven
directory into NetBeans...
pdfcrowd.com
pdfcrowd.com
NEXT...
pdfcrowd.com
And you should see your project into NetBeans Projects lists.
pdfcrowd.com
Note: if the IMPORT packages in the java class seem to be broken, just RIGHT-CLICK on the
project -> "Build with Dependences" should resolve it (it takes some time...)
You can download other artifacts from :
the official archetype catalog
the official snapshot catalog (scroll down until <!-- POGAMUT 3.3.1 --> )
You can also find some Maven project examples into Pogamut/archetypes/ut2004 folder ....
:)
or
sudo ./ucc-bin server CTF-1on1-Joust?game=GameBots2004.BotCTFGame?timelimit=999999
open in browser PRO version
pdfcrowd.com
If it asks for a server-key, you could get one here, and then type on the console in the System
directory:
echo "SRVER-xxxxx-xxxxx-xxxxx" > ./cdkey
where SRVER-xxxxx-xxxxx-xxxxx is your key code.
I got this:
Executing Class Engine.ServerCommandlet
Browse:
CTF-1on1-Joust?Name=Manu?Class=Engine.Pawn?Character=Jakob?team=255?game=GameBots2004.BotCTFGame?
timelimit=999999
Collecting garbage
Purging garbage
Garbage: objects: 33550->33546; refs: 386745
Game class is 'BotCTFGame'
Bringing Level CTF-1on1-Joust.myLevel up for play (20) appSeconds: 19.849080...
GameInfo::InitGame : bEnableStatLogging False
UdpServerQuery(crt): Port 7787 successfully bound.
Resolving master0.gamespy.com...
MasterServerUplink: MasterServerGameStats not found - stats uploading disabled.
Defaulting to false
Defaulting to false
Resolving ut2004master2.epicgames.com...
Webserver is not enabled. Set bEnabled to True in Advanced Options.
GB server on.
pdfcrowd.com
pdfcrowd.com
localhost:3001
localhost:3002
From the Pogamut tutorial you can read: "You can start the bot by pressing F6 ( Run Main Project ).
If everything works fine, the bot will connect to the server and begin execution. After starting, the bot will
appear under the Local UT node in Pogamut bots folder. It will be represented by a node
named EmptyBot. If you select the bot's node, you will see some additional information about the bot
in Properties window (Window Properties). Agent3D section shows properties defining bot's
position in the space, Agent configuration section enables you to change bot's behavior/abilities (e.g.
open in browser PRO version
pdfcrowd.com
if the bot will be able to use raycasting, if it will automatically pick up items etc.). You will see that the
bot is standing still, no movement, no rotation, after all, that's what it was designed for.
Start the UT directly from Netbeans
Right click Local UT server node and select Spectate action, the UT2004 will start in the spectate
mode and it will be automatically connected to the selected server.
pdfcrowd.com
9)Start UT2004
Open UT2004-the game --> Join Game --> LAN tab --> UT2004 Server --> double Click on it.
Or better, just run the game typing in your Linux console:
./ut2004 127.0.0.1
pdfcrowd.com
I hope that everything went the right way, check the comments below, feel free to post comments or
issues, please provide me a feedback ;-) AND DON'T FORGET TO +1' !
Posted 9th September 2012 by Manuele Dones
Labels: GameBots2004, UT2004, Linux, bot, Maven, netBeans, Unreal Tournament 2004, Ubuntu
DEC
22
This is the way I managed to install Ruby on rails 3.1 with SQLite3 on Fedora 15.
1) Install the required libraries (if they're already not installed yet)
pdfcrowd.com
check the successful installation running gem -v: it should reply "1.8.15"
4) Install rails running su -c 'gem install rails' (it takes a while, don't worry)
check if everything's ok using the commands "rails -v" (you should get "rails 3.1.0") or "gem list"
pdfcrowd.com
DEC
22
pdfcrowd.com
Open the console: START --> type cmd into the search-input-box
pdfcrowd.com
Check the successful installation of Ruby running ruby -v into the console. If you type gem -v it
will answer with 1.5.2. Since this version is a bit old you may prefer to install the newest one (if you
want to keep the 1.5.2 version you should skip the next 3 steps)
1. (optional) Install Ruby GEM. Download from ruby gem official web page the file rubygems1.8.12.zip, and unzip it somewhere on your computer, i suggest you on the Desktop.
2. (optional). Type the path at your unzipped folder, for example cd Desktop\rubygems-1.8.12 and
run setup ruby.rb
3. (optional) You can check running gem -v that the version is now 1.8.12.
pdfcrowd.com
Unzip both of them and put all the files in your Rails bin folder under Rails directory (in my case is
C:\Rails192\bin)
Create a project: type rails new myapp in the cmd console.
Type cd myapp to put the console into your project folder
Type rake db:create in order to build the test and development databases.
If the console answer you with the error: Rake aborted! Uninitialized constant Rake::DSL you
have to add the line: require 'rake/dsl_definition' on the first line in the file named Rakefile in the
directory of your project.
Repeat the commands rake db:create and rake db:migrate to check if the error is gone.
Type rails server to turn on the server, and surf on http://localhost:3000 to check if the rails
server is working correctly!
Now you can create your web applications, if you're a newbie my advise is to start from the official
documentation.
Coming soon the steps for using ruby on rails with MySQL dbms, be patient!
I hope that everything went the right way, check the comments below, feel free to post comments or
issues, please provide me a feedback ;-) AND DON'T FORGET TO +1 !
Posted 22nd December 2011 by Manuele Dones
Labels: ruby on rails mysql sqlite3 windows
pdfcrowd.com
SEP
22
Since I got some troubles to get working the google+ API, I'd just like to write how I solved my problem.
Have a look at the official Google+ API.
On first you have to activate the Google+ API on the apis console web site
Then I thought a simple AJAX calling would work, like
v ar url="https://w w w .googleapis.com/plus/v 1/people/105108020644809221643?key=##yourKey##";
aj ax.open("GET", url, true); //ajax is an xmlHttpRequest (cross-browser) objec t
aj ax.send(null);
if ( aj ax.readyState == 4 ) {
// your code
}
Unluckily this didn't work, I received the error message: Origin is not allowed by Access-ControlAllow-Origin.
I suppose the error is related with the xmlHttpRequest object: it only receives xml or text data. In fact
resources in the Google+ API are represented using JSON data formats.
A possible solution may be to "translate" the json file returned from the Google server in a javascript
variable, something like:
var jsondata = eval(" ("+ajax.responseText+ ") ")
open in browser PRO version
pdfcrowd.com
$.aj ax({
url: "https://w w w .googleapis.com/plus/v 1/people/105108020644809221643?key=##yourKey##",
context: document.body,
dataType: 'j sonp',
success: function(data){
alert(data.aboutMe);
}
});
That's all!! Feel free to post comments, please provide me a feedback ;-) AND DON'T FORGET TO
+1' !
pdfcrowd.com
JUL
15
pdfcrowd.com